Repository navigation
bug: upgrade moment 2.15.1 → 2.29.4 to fix locale directory traversal (CVE-2022-24785) - #1129
Open
Shrinandan-N wants to merge 1 commit into
Open
Shrinandan-N wants to merge 1 commit into
Shrinandan-N wants to merge 1 commit into
Conversation
…2022-24785) Co-Authored-By: nandu.narayanan <nandu.narayanan@cognition.ai>
|
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
moment@2.15.1loads locales withrequire('./locale/' + name)without sanitizingname, so a user-controlled locale can traverse out of the locale dir andrequirearbitrary.jsfiles (CVE-2022-24785 / SNYK-JS-MOMENT-2440688, CWE-22). In this app the/importhandler inroutes/index.jspasses the third CSV column of an uploaded file straight intomoment.locale(locale).Fix: pin
momentto2.29.4(fix landed in 2.29.2; 2.29.4 also covers the later RFC2822 ReDoS, CVE-2022-31129) and updatepackage-lock.json(lockfileVersion 2 preserved; only the moment entries changed).End-to-end verification — ran the app (
npm start, MongoDB 3.6) andPOST /importwith this CSV, where/tmp/evil/pwn.jslogsTRAVERSAL EXECUTED:TRAVERSAL EXECUTED— arbitrary file was requiredValid locales still work on 2.29.4: "Safe todo" imports as
Safe todo [1 janvier 2020].Devin-Org: engineering
Link to Devin session: https://devin-gtm.devinenterprise.com/sessions/4c4e10df534d47a4bd27fc737ef0a263
Open in Devin Desktop: https://devin-gtm.devinenterprise.com/desktop/session/4c4e10df534d47a4bd27fc737ef0a263?variant=devin
Requested by: @Shrinandan-N
Devin Review