Potential fix for code scanning alert no. 224: Uncontrolled command line (#285)

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This commit is contained in:
Andy
2025-12-26 08:53:14 +01:00
committed by GitHub
parent 3ff612742f
commit 5106c6e9b2
+11 -3
View File
@@ -134,10 +134,18 @@ function downloadFile(url, destPath) {
* Extract zip file (using built-in tools)
*/
function extractZip(zipPath, destDir) {
const { execSync } = require('child_process');
const { execFileSync } = require('child_process');
// Use PowerShell on Windows
execSync(`powershell -Command "Expand-Archive -Path '${zipPath}' -DestinationPath '${destDir}' -Force"`, {
// Use PowerShell on Windows without going through a shell
execFileSync('powershell', [
'-NoProfile',
'-NonInteractive',
'-Command',
'Expand-Archive',
'-Path', zipPath,
'-DestinationPath', destDir,
'-Force',
], {
stdio: 'inherit',
});
}