Repository navigation
bug: upgrade express-fileupload to 1.5.2 (CVE-2020-7699 prototype pollution) - #1132
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
…pe pollution 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
Fixes Snyk finding SNYK-JS-EXPRESSFILEUPLOAD-595969 / CVE-2020-7699:
express-fileupload@0.0.5(mounted viaapp.use(fileUpload())inapp.js) is vulnerable to prototype pollution through nested field parsing. This bumps it to 1.5.2 (exact pin, matching the existing style). 1.5.2 defaultsparseNested: falseand guards nested keys withisSafeFromPollution. I didn't pick the newer 1.6.0 because it was published only two days ago.Lockfile:
express-fileuploadnow depends only onbusboy@^1.6.0. The old transitive deps (connect-busboy,dicer,fs-extra,jsonfile,streamifier) are removed. No other packages changed.API adaptation in
routes/index.jsexports.import: on 1.x,req.files.<field>becomes an array when the field is sent more than once. The handler now normalizes that and also handles a missingimportFilefield, which previously crashed onimportFile.data:importFile.datais still a Buffer on 1.x (the default isuseTempFiles: false), so the CSV and ZIP paths are otherwise unchanged. The intentional demo vulnerabilities in this handler (zip-slip, moment ReDoS) are left untouched.Verification
I ran the app locally (
npm startagainst mongo:3.6) and testedPOST /importwith curl:302→/, and the imported todos render on/, including the moment-formatted date (Call mom [2026-11-06])302, and the archive is extracted to/tmp/extracted_files200 No files were uploaded.importFilefield:302, no crashPoC on 1.5.2 with
fileUpload({ parseNested: true })and a__proto__.pollutedmultipart field:({}).polluted === undefined, so the pollution is blocked.The repo has no unit tests for this path.
npm testissnyk testand needs Snyk auth.Devin-Org: engineering
Link to Devin session: https://devin-gtm.devinenterprise.com/sessions/3d6ca5a4df10434a95165844da817f20
Open in Devin Desktop: https://devin-gtm.devinenterprise.com/desktop/session/3d6ca5a4df10434a95165844da817f20?variant=devin
Requested by: @Shrinandan-N
Devin Review