Skip to content
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

Update cookie semver lock to address CVE-2024-47764 #6017

Merged
merged 3 commits into from
Oct 8, 2024

Conversation

joshbuker
Copy link
Contributor

@joshbuker joshbuker commented Oct 4, 2024

Per CVE-2024-47764 (GHSA-pxg6-pf52-xh8x), versions < 0.7.0 of cookie have a low severity vulnerability.

Because express uses a strict semver lock of 0.6.0 this will cause downstream projects to pull a vulnerable version of cookie unless they explicitly overwrite the resolution in their package.json with:

"resolutions": {
  "cookie": ">= 0.7.0"
},

Updating the semver to ^0.7.1 to both resolve the vulnerability and allow backwards compatible updates in the future.

Fixes #6019

Per CVE-2024-47764 (GHSA-pxg6-pf52-xh8x), versions `< 0.7.0` of `cookie` have a low severity vulnerability.

Because express uses a strict semver lock of `0.6.0` this will cause downstream projects to pull a vulnerable version of cookie unless they explicitly overwrite the resolution in their `package.json` with:

```json
"resolutions": {
  "cookie": ">= 0.7.0"
},
```

Updating the semver to `^0.7.1` to both resolve the vulnerability and allow backwards compatible updates in the future.
joshbuker added a commit to bigbrainenergy-org/web.tdl.app that referenced this pull request Oct 4, 2024
We can remove the resolutions thing from package.json once my PR to express gets merged:
expressjs/express#6017
@kurt-apple
Copy link

This PR fixes #6019

@RobinTail
Copy link
Contributor

Should be no breaking changes https://github.com/jshttp/cookie/releases

@wesleytodd , please review

Copy link
Member

@bjohansebas bjohansebas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the history file

@joshbuker
Copy link
Contributor Author

@bjohansebas Updated the history file. If it doesn't look quite right, or you'd like to make other changes, maintainer edits on the PR are enabled. Thanks!

package.json Outdated Show resolved Hide resolved
@G-Rath
Copy link

G-Rath commented Oct 6, 2024

I'm conscious that this is against the v5 branch which isn't actually released and even if it was express v4 underpins half of the big players in the ecosystem so would like to get the ball rolling as much as possible on backporting: is that something people are open to, and if so would it be helpful to open a PR against the v4 branch or is the preferred process to wait until this is landed on v5 then cherry-pick or...?

I have the bandwidth for doing a PR to the v4 branch if that is the process

@RobinTail
Copy link
Contributor

This PR targets master branch having v5 merged and released

@G-Rath
Copy link

G-Rath commented Oct 6, 2024

sorry I meant released as the latest version - I thought it was still in the final beta period which is why it's not tagged as latest on NPM:

image

Either way I think it's going to be a long time until the rest of the ecosystem has caught up given that v5 requires a min. of Node v18 and how widespread its usage is, so it'd still be very useful to have it backported to v4.

@RobinTail
Copy link
Contributor

RobinTail commented Oct 6, 2024

it'd still be very useful to have it backported to v4

I agree. No doubt.
It should be backported/cherry-picked into 4.x branch after it's fixed in master.

@UlisesGascon UlisesGascon self-assigned this Oct 7, 2024
@UlisesGascon
Copy link
Member

I will prepare a release today/tomorrow that includes this PR and other things.

@joshbuker are you willing to create another PR targeting branch 4.x as suggested by @RobinTail ? That way we cover 4.x too 👍 Otherwise I can do the cherry pick once this is landed in master.

@jasonhocker
Copy link

Will this also update express-session's version of cookie that is used?

@med-Haithem
Copy link

I will prepare a release today/tomorrow that includes this PR and other things.

@joshbuker are you willing to create another PR targeting branch 4.x as suggested by @RobinTail ? That way we cover 4.x too 👍 Otherwise I can do the cherry pick once this is landed in master.

Please when a new patch will be realeased in v4.21 ?

@pumano
Copy link

pumano commented Oct 7, 2024

Would love to see it landed to 4.x branch too (and released).

@joshbuker
Copy link
Contributor Author

joshbuker commented Oct 7, 2024

Sure, I can create a PR for the 4.x branch as well. Thanks for the ping @UlisesGascon, @kurt-apple.

Edit: Created #6029

@UlisesGascon UlisesGascon merged commit 2027b87 into expressjs:master Oct 8, 2024
19 checks passed
@shivam-sharma7
Copy link

shivam-sharma7 commented Oct 9, 2024

@UlisesGascon @blakeembrey I think we should use v1.0.0 instead 0.7.1 see changelog-> https://github.com/jshttp/cookie/releases/tag/v1.0.0

I can provide a PR! if you agree?

@UlisesGascon
Copy link
Member

@shivam-sharma7 thanks for the proposition, feel free to create a PR for this 👍

@blakeembrey
Copy link
Member

Upgrading to 1.0.0 would have breaking changes and would be better for an Express 6 release, since 5 is already released.

@shivam-sharma7
Copy link

@blakeembrey and @UlisesGascon Thanks for suggetion. Let's keep track in issue or ... ?

@NewEraCracker
Copy link

My take:

  • 0.7.2 for express 4
  • 1.0.0 for express 5

The breaking change of 1.0.0 is because it only supports node.js 18+ like express 5 only supports node.js 18+.

My two cents.

@RobinTail
Copy link
Contributor

Upgrading to 1.0.0 would have breaking changes

I also did't understand this.
If the only breaking change is Node.js version, then it's fully compatible with Express 5 conditions.

@blakeembrey
Copy link
Member

It's definitely not just the node version, the release notes are here: https://github.com/jshttp/cookie/releases/tag/v1.0.0

Please don't just bump things without checking release notes for breaking changes.

@blakeembrey
Copy link
Member

Let's keep track in issue or ... ?

Probably an issue or PR that we should tag with "express 6", I don't think there's a dev branch for it yet to target.

@RobinTail
Copy link
Contributor

RobinTail commented Oct 10, 2024

without checking release notes for breaking changes

It would be easier if you could mark some of those changes as breaking, @blakeembrey
Since currently it's not so obvious, right?

release notes

@blakeembrey
Copy link
Member

Understandable, the entire section called "Changed" is breaking changes, is there a preferred title you use? Usually a major version implies breaking changes, so I haven't had this be an issue before.

@shivam-sharma7
Copy link

Let's keep track in issue or ... ?

Probably an issue or PR that we should tag with "express 6", I don't think there's a dev branch for it yet to target.

Yeah, I think we should have a branch for express 6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dependency on cookie 0.6.0 fails npm audit