Skip to content

Commit 6a853ba

Browse files
chore: new release with minimal changes
1 parent be7bbcf commit 6a853ba

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/core/selfUpdate.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,9 @@ export async function applyUpdateInstaller(installerPath: string, silent: boolea
177177

178178
if (elevate) {
179179
// Use PowerShell Start-Process -Verb RunAs
180-
// We use a script block and pass arguments to avoid injection
181-
const psCommand = '& { param($p, $a) Start-Process -FilePath $p -ArgumentList $a -Verb RunAs -Wait }';
182-
await execa('powershell', ['-NoProfile', '-Command', psCommand, installerPath, args.join(' ')]);
180+
// Use $args array to pass parameters safely to the script block, avoiding command injection
181+
const psCommand = '& { $p, $a = $args; Start-Process -FilePath $p -ArgumentList $a -Verb RunAs -Wait }';
182+
await execa('powershell', ['-NoProfile', '-NonInteractive', '-Command', psCommand, installerPath, ...args]);
183183
} else {
184184
await execa(installerPath, args);
185185
}

0 commit comments

Comments
 (0)