Skip to content

fix: command injection in todo image identify (CWE-78) - #232

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1787665373-fix-identify-command-injection
Open

fix: command injection in todo image identify (CWE-78)#232
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1787665373-fix-identify-command-injection

Conversation

@devin-ai-integration

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

Copy link
Copy Markdown

Summary

exports.create in routes/index.js passed a user-controlled URL, taken from todo content, straight into a shell string: exec('identify ' + url, ...), so any shell metacharacter in the URL ran as OS commands.

The sink now uses execFile with an argv array (no shell) and validates the URL first:

- exec('identify ' + url, cb)
+ if (isSafeImageUrl(url)) execFile('identify', [url], cb)

isSafeImageUrl rejects non-strings/whitespace and requires new URL(url).protocol to be http:/https: — which also prevents the argument from being interpreted as an ImageMagick option (-write ...) or a local file:/path read.

Written by Devin

Devin-Org: engineering


Devin Review

Status Commit
⚪ Not started

Run Devin Review

Devin Review (Staging)

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