-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(deps): override body-parser and bump express COMPASS-8288) #6226
Conversation
package.json
Outdated
@@ -95,6 +95,7 @@ | |||
"scripts" | |||
], | |||
"overrides": { | |||
"mongodb-client-encryption": "^6.1.0" | |||
"mongodb-client-encryption": "^6.1.0", | |||
"body-parser": "^1.20.3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fwiw, in order to bump a transitive dependency, you don't usually need to put the nested dependency in overrides
, unless the intermediate dependency (express
in this case, I guess) has a dependency specification that conflicts with the new version.
It should be enough here to update our package-lock.json
, i.e. you can remove this line, run npm install
and the package-lock.json
should still point to 1.20.3
without issues. That's going to simplify things a bit once our dependencies start depending on body-parser 2.x, for example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think it should be enough to bump express in this case and update package-lock with install, express has an exact version specified for body-parser and express version change should've bumped it in package lock too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this PR is to address the vulnerability in body-parser 1.20.2 (added COMPASS-8288).
With bump in express, the package lock does update it correctly for compass-web package. But we also have express in compass-oidc and it resolves to body-parser version 1.20.2.
Running npm install
with npm update express
correctly updates the deps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool – opened mongodb-js/mongosh#2166 for the mongosh equivalent 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aaaaah, finally got it, I was assuming this whole time that it's only due to express here having the "older" version than the one in oidc-plugin that the error is being triggered. Thanks for clarifying!
Oh, also: Is this to fix some specific issue? If yes, we'll probably need the same for mongosh |
Can we add a ticket link on the PR and some more context on the description, so that whoever will have to deal with this in future can get some context from the git history / blame at least. |
Description
Checklist
Motivation and Context
Open Questions
Dependents
Types of changes