-
Notifications
You must be signed in to change notification settings - Fork 2k
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
apollo-server-express dependency on cookie <7.0 (CVE-2024-47764) #7936
Comments
I'll put out a patch release that includes this upgrade, because it's nice to not have copies of modules with CVEs installed in your server. However, I don't think there's an actual vulnerability here (assuming you are using Apollo Server in a typesafe way respecting our TypeScript declarations). Apollo Server 4 uses Express in two ways. First, it exports an Second, it exports (Apollo Server 2 and 3 have a different relationship to Express, in the |
`@apollo/server` depends on `express` which depends on `cookie`. Versions of `express` older than v4.21.1 depend on a version of `cookie` vulnerable to CVE-2024-47764. Users of older `express` versions who call `res.cookie()` or `res.clearCookie()` may be vulnerable to this issue. However, Apollo Server does not call this function directly, and it does not expose any object to user code that allows TypeScript users to call this function without an unsafe cast. The only way that this direct dependency can cause a vulnerability for users of Apollo Server is if you call `startStandaloneServer` with a context function that calls Express-specific methods such as `res.cookie()` or `res.clearCookies()` on the response object, which is a violation of the TypeScript types provided by `startStandaloneServer` (which only promise that the response object is a core Node.js `http.ServerResponse` rather than the Express-specific subclass). So this vulnerability can only affect Apollo Server users who use unsafe JavaScript or unsafe `as` typecasts in TypeScript. However, this upgrade will at least prevent vulnerability scanners from alerting you to this dependency, and we encourage all Express users to upgrade their project's own `express` dependency to v4.21.1 or newer. Fixes #7936.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Issue Description
Express dependency on cookie <7.0 CVE-2024-47764
Affected versions of this package are vulnerable to Cross-site Scripting (XSS) via the cookie name, path, or domain, which can be used to set unexpected values to other cookie fields.
Link to Reproduction
GHSA-pxg6-pf52-xh8x
Reproduction Steps
Express dependency on cookie <7.0 CVE-2024-47764
The text was updated successfully, but these errors were encountered: