Skip to content

Conversation

@HerrTopi
Copy link
Contributor

@HerrTopi HerrTopi commented Dec 3, 2025

No description provided.


function bootstrap() {
execSync(path.resolve('scripts/clean.js'), opts)

Check warning

Code scanning / CodeQL

Shell command built from environment values Medium

This shell command depends on an uncontrolled
absolute path
.

Copilot Autofix

AI 29 days ago

To eliminate the risk, refactor the code so that the child process executes the script directly via Node using its arguments array (and not via a shell command string). Replace the execSync invocation with fork, or with execFileSync('node', [cleanScriptPath], opts). This removes shell interpretation risk.

Steps:

  • Change execSync(path.resolve('scripts/clean.js'), opts) to fork(cleanScriptPath, [], opts), or use execFileSync('node', [cleanScriptPath], opts).
  • Ensure that cleanScriptPath uses path.resolve as before, to compute the absolute path to scripts/clean.js.
  • If you use fork, note it runs the Node file as a child process (recommended for local scripts); if you use execFileSync, you must invoke node and pass the script path as an argument.

No new methods or imports are needed; fork is already imported from 'child_process' at the top of the file.


Suggested changeset 1
scripts/bootstrap.js

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/scripts/bootstrap.js b/scripts/bootstrap.js
--- a/scripts/bootstrap.js
+++ b/scripts/bootstrap.js
@@ -65,7 +65,7 @@
 }
 
 function bootstrap() {
-  execSync(path.resolve('scripts/clean.js'), opts)
+  fork(path.resolve('scripts/clean.js'), [], opts)
   buildProject()
 }
 
EOF
@@ -65,7 +65,7 @@
}

function bootstrap() {
execSync(path.resolve('scripts/clean.js'), opts)
fork(path.resolve('scripts/clean.js'), [], opts)
buildProject()
}

Copilot is powered by AI and may make mistakes. Always verify output.
@github-actions
Copy link

github-actions bot commented Dec 3, 2025

PR Preview Action v1.6.3
Preview removed because the pull request was closed.
2025-12-16 09:33 UTC

@HerrTopi HerrTopi changed the base branch from master to v12 December 3, 2025 14:06
@matyasf matyasf closed this Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants