Skip to content

bug: corrige code injection no dustjs-linkedin (CVE-2021-4264) em /about_new - #1123

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/sfind-a3ce214b-dustjs-linkedin-code-injection
Open

devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/sfind-a3ce214b-dustjs-linkedin-code-injection

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Summary

Corrige o finding sfind-a3ce214b8e5842808ddff12fe5401f40 (Snyk SNYK-JS-DUSTJSLINKEDIN-1089257 / CVE-2021-4264, code injection no dustjs-linkedin@2.5.0).

GET /about_new (sem auth) passava req.query.device direto para views/about_new.dust, que usava {@if cond="'{device}'=='Desktop'"}. O @if faz eval(cond) e o dust 2.5.0 não escapa arrays, então ?device[]=x'-require('child_process').execSync('id')-' executava código no servidor.

Mudanças (cada uma quebra o ataque sozinha):

  • package.json / lock: dustjs-linkedin 2.5.0 → 2.7.5 (≥ 2.6.0 recomendado pelo Snyk) e dustjs-helpers 1.5.0 → 1.7.4 (peer dep compatível; o @if com eval foi removido). O lock cresce porque o dust 2.7 traz chokidar/cli.
  • views/about_new.dust: {@if cond=...} → {@eq key=device value="Desktop"} (comparação sem eval).
  • routes/index.js: device: typeof req.query.device === 'string' ? req.query.device : ''.

Duplica o PR #1101 (finding sfind-b2240f4c) e os PRs #1071/#1085 (upgrade só para 2.6.0); apenas um deve entrar.

Verificação

App real (app.js, MySQL em docker + Mongo em memória), GET /about_new:

Request main (2.5.0) este PR (2.7.5)
?device=Desktop 200, desktop 200, desktop
?device=Mobile 200, mobile 200, mobile
?device[]=x'-require('fs').writeFileSync(...)-' arquivo criado (RCE) nenhum arquivo
?device[]=x'-process.exit()-' servidor morre 200, servidor continua no ar

Devin-Org: engineering

Link to Devin session: https://devin-gtm.devinenterprise.com/sessions/3d9f909de4e3400fa50a96e03292fc8c
Open in Devin Desktop: https://devin-gtm.devinenterprise.com/desktop/session/3d9f909de4e3400fa50a96e03292fc8c?variant=devin


Devin Review

Status Commit
⚪ Not started —

Run Devin Review

Enable auto-review to review your pull requests automatically.

Devin Review (Staging)


Devin Review

Upgrade dustjs-linkedin 2.5.0 -> 2.7.5 and dustjs-helpers 1.5.0 -> 1.7.4
(the eval-based @if helper is gone), replace {@if cond=...} with {@eq}
in views/about_new.dust, and only pass a string device query param.

Refs: sfind-a3ce214b8e5842808ddff12fe5401f40 (SNYK-JS-DUSTJSLINKEDIN-1089257)
Signed-off-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updateddustjs-helpers@​1.5.0 ⏵ 1.7.488 +61007675100
Updateddustjs-linkedin@​2.5.0 ⏵ 2.7.588 -18584 -685 +1100

View full report

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

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