-
-
Notifications
You must be signed in to change notification settings - Fork 21.8k
Release: 5.2.1 #6933
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
Release: 5.2.1 #6933
Conversation
This reverts commit 2f64f68.
|
why revert the security patch? |
|
Wow this is sus AF. |
|
@UlisesGascon @jonchurch @ctcpip Could you guys provide a reason why this was reverted? I'm reading in #6931 that the change is a semver major => does that mean you'll release 6.0.0 with that change in place? Or what's the plan here? |
|
Hi, why revert a security patch, without explanation? |
|
Reverting that commit brings back Even if the original fix was considered semver-major, this rollback effectively restores a known security issue in the v5 line. Could the @jonchurch, @UlisesGascon clarify:
This reversion has real security implications, so any guidance would be appreciated. |
|
Good thing I checked the changelog. Due to the lack of any explanation, I’m sticking with version 5.2.0 for now, the whole situation feels rather suspicious. At this point, I can’t exclude the possibility that something malicious might have been injected into the npm package |
|
Sorry for the earlier lack of clarity regarding the commit revert and the subsequent release. We decided to release this version with the revert because:
The underlying issue is that I included that commit prematurely in the releases (4.22.0 and 5.2.0) . That CVE was created before we introduced the Incident Response Plan (ref: expressjs/security-wg#56) and was never migrated to follow the updated process. We are considering preparing a brief post-mortem to clarify what happened and to outline some changes we plan to implement to prevent this root cause from occurring again in the future. |
|
But this leaves 5.2.1 and other versions except for 5.2.0 still subject to a quite serious vulnerability? |
As far as I understand the low severity "vulnerability" is that properties that exist in object's prototype could be overwritten (e.g. Let's say you have code like this (maybe one that makes sense): app.set('query parser', 'extended');
app.use((req, res, next) => {
console.log(req.query.hasOwnProperty === 'abc');
next();
});This worked fine and with the patch still works as the author intended - it expects Now imagine that you have instead: app.set('query parser', 'extended');
app.use((req, res, next) => {
console.log(req.query.hasOwnProperty('foo'));
next();
});Without the patch this will throw an error for Now comes the patch and solves the problem - Disclaimer: I wrote this on my phone, while doing other things, so there may be mistakes in this response, as I haven't run any code to verify it. |
|
Important The prior release (5.2.0) included an erroneous breaking change related to the extended query parser. There is no actual security vulnerability associated with this behavior (CVE-2024-51999 has been rejected). The change has been fully reverted in this release. |
|
@RedShift1 I just wanted to jump in clarify that there wasn't a vulnerability here. There should be a post-mortem on why it was released at all, but GHSA-pj86-cfqh-vqx6 is invalid because there isn't any prototype pollution or other vulnerability. @krzysdz's response has a great explanation on why it's not a vulnerability, and I wanted to further add that this is just the behavior of JavaScript and anything that parses user supplied data, such as The issue that can occur with your code is that you might want to do something like If you are concerned about object keys that match the names of prototype keys, you can provide your own parser: app.set('query parser', function (str) {
return qs.parse(str);
});But keep in mind that if you expect a key that matches one on the prototype, such as |
|
Hi all, I’m following up because we did the post-mortem for how we released the invalid advisory and patch before reverting them in this PR. First I want to share more context. The patch was intended to fix a concern around keys with the same name as prototype properties, and was raised in 2018. This pre-dated current processes and the project’s revival, as well as many of the current maintainers involvement. As part of the V5 release in 2024, the issue was revived, discussed, and a draft advisory with a fix was created. A few days later it was determined that this is not a vulnerability, but all the artifacts were left open (GitHub advisory, private security PR with approval, etc). Last month, when a new release was planned, the advisories were reviewed for things to include, and the lingering advisory from 2024 looked “good” (it was approved and had a clear description) and was included in the release when it shouldn’t have. It was quickly noticed after the initial release, reverted, and released (here) without the change. This PR should have included a description, and in retrospect the fact it was missing does look alarming. This release was done quickly after noticing the release could be a breaking change, and in sync over a video call for consensus, but it still should have included as much detail as possible for everyone else not involved. Why did we revert at all? The “fix” in 5.2.0 is a breaking change. Although unlikely, it’s possible a user previously expected to access these prototype properties (e.g. Side note: We do not recommend using Finally, we have a few action items as a team:
Because security fixes happen in private, separate from the main repo, context is sometimes hard to follow. We’re confident our current process would not let this happen, but this specific issue pre-dated our current process and should have been closed or migrated long ago. |
Important
The prior release (5.2.0) included an erroneous breaking change related to the extended query parser. There is no actual security vulnerability associated with this behavior (CVE-2024-51999 has been rejected). The change has been fully reverted in this release.