Skip to content

Conversation

@Shellishack
Copy link
Collaborator

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Nov 18, 2025

⚠️ No Changeset found

Latest commit: e585c4a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Nov 18, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
web-editor Ready Ready Preview Comment Nov 18, 2025 6:07am


export async function cleanDist() {
console.log('♻️ Cleaning dist directory...');
await execa(`${getDepsBinPath('rimraf')} dist`, {

Check warning

Code scanning / CodeQL

Shell command built from environment values Medium

This shell command depends on an uncontrolled
absolute path
.

Copilot Autofix

AI 6 days ago

To fix this vulnerability, we should avoid forming a full command string and using the shell: true option, since this subjects the input to shell parsing. Instead, we should call execa() with the command and its arguments as separate parameters, ensuring user-supplied or environment-derived values are not interpreted by the shell.

Specifically:

  • If getDepsBinPath('rimraf') returns a command like 'npx rimraf', we should split it into command ('npx') and arguments (['rimraf', 'dist']).
  • If it returns a direct path like .../.bin/rimraf, we should call that path with ['dist'] as the argument.
  • Therefore, we need code to:
    • Parse the result from getDepsBinPath into command and arguments.
    • Call execa(cmd, args) (with no shell:true), not one command string.
  • Only the npm-packages/cli/source/lib/execa-utils/clean.ts file needs changing.

Suggested changeset 1
npm-packages/cli/source/lib/execa-utils/clean.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/npm-packages/cli/source/lib/execa-utils/clean.ts b/npm-packages/cli/source/lib/execa-utils/clean.ts
--- a/npm-packages/cli/source/lib/execa-utils/clean.ts
+++ b/npm-packages/cli/source/lib/execa-utils/clean.ts
@@ -3,8 +3,8 @@
 
 export async function cleanDist() {
 	console.log('♻️  Cleaning dist directory...');
-	await execa(`${getDepsBinPath('rimraf')} dist`, {
-		shell: true,
-	});
+	const cmdLine = getDepsBinPath('rimraf');
+	const [cmd, ...cmdArgs] = cmdLine.split(' ');
+	await execa(cmd, [...cmdArgs, 'dist']);
 	console.log('✅ Cleaned dist directory.');
 }
EOF
@@ -3,8 +3,8 @@

export async function cleanDist() {
console.log('♻️ Cleaning dist directory...');
await execa(`${getDepsBinPath('rimraf')} dist`, {
shell: true,
});
const cmdLine = getDepsBinPath('rimraf');
const [cmd, ...cmdArgs] = cmdLine.split(' ');
await execa(cmd, [...cmdArgs, 'dist']);
console.log('✅ Cleaned dist directory.');
}
Copilot is powered by AI and may make mistakes. Always verify output.
@Shellishack Shellishack merged commit 17740b8 into main Nov 18, 2025
12 checks passed
@Shellishack Shellishack deleted the dev branch November 18, 2025 06:11
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.

2 participants