Repository navigation
bug: upgrade dustjs-linkedin to 2.6.1 to fix code injection (CVE-2021-4264) - #1128
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
…-4264 / SNYK-JS-DUSTJSLINKEDIN-1089257)
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
Upgrades
dustjs-linkedinfrom2.5.0to2.6.1to fix the critical code injection SNYK-JS-DUSTJSLINKEDIN-1089257 / CVE-2021-4264 (CWE-94).How the attack works:
routes.about_newpassesreq.query.deviceintoviews/about_new.dust, which renders{@if cond="'{device}'=='Desktop'"}. Thedustjs-helpers@ifhelper runscondthrougheval. In 2.5.0,dust.escapeHtmlreturns non-strings unchanged. So?device[]=Desktop'-require('child_process')...-'skips HTML escaping, closes the string literal, and runs arbitrary JS. From 2.6.0 on, arrays are stringified and escaped ('becomes'), so the payload stays a plain string.Why 2.6.1: The pinned
dustjs-helpers@1.5.0has peerDependencydustjs-linkedin: "2.5 - 2.6", so 2.6.x is the highest line that works without also upgrading helpers. 2.6.2 and later add an oldchokidar1.x dependency tree (~140 packages, only used bydustcwatch mode). 2.6.1 only addscli@0.6.6(+exit,glob@3,minimatch@0.3,sigmund), which keeps the lockfile diff small.Only
package.jsonand the matchingpackage-lock.jsonentries change. No app code changes.Verification
I ran the real
app.jslocally and replayed the repo's ownexploits/dustjs-exploits.shpayloads.dust5was changed totouch /tmp/pwned_dustso a successful exploit is easy to see:dust1?device=Desktopfont-size: mediumfont-size: mediumdust2?device[]=Desktopfont-size: mediumfont-size: mediumdust3?device[]=Desktop'dust5RCE payload/tmp/pwned_dustcreatedNotes: the repo has no unit tests for this path, and
npm testissnyk test, which needs Snyk auth. To run the app locally I had to swallow unrelated startup errors from MongoDB and MySQL seeding:mongoose@4.2.4can't talk to the box's mongod 7, and the MySQL port didn't match. Neither affects/about_new.Link to Devin session: https://devin-gtm.devinenterprise.com/sessions/a1105cb4d9ac4a1e8bcd9c32208bde5a
Open in Devin Desktop: https://devin-gtm.devinenterprise.com/desktop/session/a1105cb4d9ac4a1e8bcd9c32208bde5a?variant=devin
Devin Review