Skip to content

Fix OS command injection in POST /create (package install feature finding) - #237

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1787932975-create-cmdinj-pkg-install
Open

Fix OS command injection in POST /create (package install feature finding)#237
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1787932975-create-cmdinj-pkg-install

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Aug 28, 2026

Copy link
Copy Markdown

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:

exec('identify ' + url, ...)   // url comes straight from the todo item text

Any todo like ![alt](http://x/;id ") 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 use child_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 via execFile with 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

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.

0 participants