Repository navigation
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
Open
devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
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>
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
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.
Summary
Corrige o finding
sfind-a3ce214b8e5842808ddff12fe5401f40(Snyk SNYK-JS-DUSTJSLINKEDIN-1089257 / CVE-2021-4264, code injection nodustjs-linkedin@2.5.0).GET /about_new(sem auth) passavareq.query.devicedireto paraviews/about_new.dust, que usava{@if cond="'{device}'=='Desktop'"}. O@iffazeval(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-linkedin2.5.0 → 2.7.5 (≥ 2.6.0 recomendado pelo Snyk) edustjs-helpers1.5.0 → 1.7.4 (peer dep compatível; o@ifcomevalfoi removido). O lock cresce porque o dust 2.7 trazchokidar/cli.views/about_new.dust:{@if cond=...}→{@eq key=device value="Desktop"}(comparação semeval).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:?device=Desktop?device=Mobile?device[]=x'-require('fs').writeFileSync(...)-'?device[]=x'-process.exit()-'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