-
-
Notifications
You must be signed in to change notification settings - Fork 17
[Aikido] AI Fix for Potential for OS command injection via child_process call #333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Deploying demo-time with
|
| Latest commit: |
7325c61
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ab582147.demo-time.pages.dev |
| Branch Preview URL: | https://fix-aikido-security-sast-117.demo-time.pages.dev |
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
|
Replace shell command execution with
|
| } | ||
|
|
||
| if (platform === 'windows' && command.toLowerCase() === 'powershell') { | ||
| command = `${command} -File`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Windows, execFile treats inline args as part of the executable. Appending -File to command makes it look for an exe named "powershell -File", causing ENOENT. Consider keeping command as "powershell" and putting -File in args (e.g., ["-File", scriptPath.fsPath]).
- command = `${command} -File`;
-
- const args = [scriptPath.fsPath];
+
+ const args = platform === 'windows' && command.toLowerCase() === 'powershell'
+ ? ['-File', scriptPath.fsPath]
+ : [scriptPath.fsPath];🚀 Want me to fix this? Reply ex: "fix it for me".



This patch mitigates command injection by passing command arguments separately instead of using string concatenation.
Aikido used AI to generate this PR.
Low confidence: Aikido has tested similar fixes, which indicate the correct approach but may be incomplete. Further validation is necessary.