Fix OS command injection in POST /create (package install feature finding) - #237
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
Fix OS command injection in POST /create (package install feature finding)#237devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
… install feature finding)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix OS command injection in POST /create ("package install feature" finding)
Summary
Remediates code-scan finding sfind-7a1a83a677484e13ae807bd6b4aef220 (CSV vulnerability inventory, repo
nodejs-goof, vuln_id 82: "Command injection in package install feature", CWE-78). nodejs-goof has no package-install feature; the actual CWE-78 sink is the todo-create handler, which shelled out with attacker-controlled input:Any todo like
executed arbitrary shell commands.Fix
routes/index.js: validate the extracted image URL (must parse as http/https with a well-formed host, reject shell metacharacters), then usechild_process.execFile('identify', [url])— no shell is ever invoked.tests/create-command-injection.spec.js: tap tests asserting shell-injection payloads never spawn a shell/child process (14 cases) and a well-formed URL is still inspected viaexecFilewith the URL as a single argv element (4 cases). All 18 pass locally.Same remediation as previously accepted PRs #129/#145/#164/#167/#176/#182/#194/#210/#216 for duplicate findings of this sink.
Written by Devin
Devin-Org: engineering