Fix security vulnerability within desktop appUpdater (#2953)

* use app.isPackaged instead of electron-is-dev
This commit is contained in:
Carlos Alcaide Corvo authored and GitHub committed 2025-08-12 11:19:43 -07:00
1 parent 942ea99459
commit 5fd9f0216a
1 file changed
+13 -10
@@ -17,7 +17,8 @@ const boundaryCli = require('../cli/index.js');
let currentVersion = config.releaseVersion;
const debug = process.env.DEBUG_APP_UPDATER;
const releasesUrl = 'https://releases.hashicorp.com/boundary-desktop/';
if (debug && process.env.APP_UPDATER_CURRENT_VERSION) {
if (!app.isPackaged && debug && process.env.APP_UPDATER_CURRENT_VERSION) {
currentVersion = process.env.APP_UPDATER_CURRENT_VERSION;
}
@@ -177,7 +178,7 @@ module.exports = {
if (!boundaryCli.isBuiltInCli) return;
let latestVersion;
if (debug) {
if (!app.isPackaged && debug) {
latestVersion = process.env.APP_UPDATER_LATEST_VERSION_TAG;
} else {
latestVersion = await findLatestVersion(releasesUrl);
@@ -197,14 +198,16 @@ module.exports = {
return;
}
const location = process.env.APP_UPDATER_LATEST_VERSION_LOCATION;
if (debug && location) {
// Support hosted url and file paths
displayDownloadPrompt(
latestVersion,
location.match(/^http/i) ? location : `file://${location}`,
);
return;
if (!app.isPackaged) {
const location = process.env.APP_UPDATER_LATEST_VERSION_LOCATION;
if (debug && location) {
// Support hosted url and file paths
displayDownloadPrompt(
latestVersion,
location.match(/^http/i) ? location : `file://${location}`,
);
return;
}
}
/**