Skip to content

fix: sanitize shell/subprocess call in foreach-example.ts (CWE-78) - #177

Open
anupamme wants to merge 1 commit into
rollbar:mainfrom
anupamme:fix-repo-rollbar-react-cwe-78-foreach-example-command-injection
Open

anupamme wants to merge 1 commit into
rollbar:mainfrom
anupamme:fix-repo-rollbar-react-cwe-78-foreach-example-command-injection

Conversation

@anupamme

@anupamme anupamme commented Oct 8, 2026

Copy link
Copy Markdown

The foreach-example.ts script constructs a command string from process.argv CLI arguments without validation or sanitization, then executes it using execSync(). The string form of execSync() invokes a shell, allowing shell metacharacters (;, |, $(), etc.) to inject arbitrary commands. The affected code is scripts/foreach-example.ts:14. This change is the fix I would apply.

Reference: CWE-78

What changed

  • scripts/foreach-example.ts

Verification

No automated check could be run against this repository, so this change is unverified beyond review. Please treat it as a suggestion.


Automated security fix by OrbisAI Security

Automated security fix generated by OrbisAI Security
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.

1 participant