{"url":"http://public2.vulnerablecode.io/api/packages/70225?format=json","purl":"pkg:npm/apollo-server-core@3.12.1","type":"npm","namespace":"","name":"apollo-server-core","version":"3.12.1","qualifiers":{},"subpath":"","is_vulnerable":true,"next_non_vulnerable_version":null,"latest_non_vulnerable_version":null,"affected_by_vulnerabilities":[{"url":"http://public2.vulnerablecode.io/api/vulnerabilities/23176?format=json","vulnerability_id":"VCID-hkjc-51h1-a7h8","summary":"Apollo Server: Browser bug allows for bypass of XS-Search (read-only Cross-Site Request Forgery) prevention\n# Impact\n\nIn a Cross-Site Request Forgery attack, untrusted web content causes browsers to send authenticated requests to web servers which use cookies for authentication. While the web content is prevented from reading the request's response due to the Cross-Origin Request Sharing (CORS) protocol, an attacker may be able to cause side effects in the server (\"CSRF\" attack), or learn something about the response via timing analysis (\"XS-Search\" attack).\n\nApollo Server has a built-in feature which prevents CSRF and XS-Search attacks: it refuses to process GraphQL requests that could possibly have been sent by a spec-compliant web browser without a protective \"preflight\" step. See [Apollo Server's docs](https://www.apollographql.com/docs/apollo-server/security/cors) for more details on CORS, CSRF attacks, and Apollo Server's CSRF prevention feature.\n\nThis feature is fully effective against attacks carried out against users of spec-compliant browsers. Unfortunately, a major browser introduced a bug in 2025 which meant in certain cases, it failed to follow the CORS spec. The browser's maintainers have already committed to fixing the bug and making the browser spec-compliant again.\n\nEven with this bug, Apollo Server's CSRF prevention feature **blocks** \"side effect\" CSRF attacks: Apollo Server will still correctly refuse to execute _mutations_ in requests that were not preflighted. However, some specially crafted authenticated GraphQL _queries_ can be issued across origins *without preflight* in buggy versions of this browser, allowing for XS-Search attacks: an attacker can analyze response times to learn facts about the responses to requests such as whether fields return null or approximately how many list entries are returned from fields.\n\nGraphQL servers are only vulnerable if they rely on cookies (or HTTP Basic Auth) for authentication.\n\n## Patches\n\nThe vulnerability is patched in `@apollo/server` v5.5.0. This release contains a single change: GraphQL requests sent in HTTP `GET` requests which contain a `Content-Type` header naming a type other than `application/json` are rejected. (`GET` requests with no `Content-Type` are allowed.) This change prevents XS-Search attacks even in browsers which are non-compliant in ways similar to this browser.\n\nThere are no known cases where GraphQL apps depend on the ability of clients to send non-empty `Content-Type` headers with GET requests other than `application/json`, so this change has not been made configurable; if this change breaks a use case, [file an issue](https://github.com/apollographql/apollo-server/issues) and more configurability can be added.\n\nApollo is not currently providing a patch for previous major versions of Apollo Server, which are all [end-of-life](https://www.apollographql.com/docs/apollo-server/previous-versions).\n\n### Workarounds\n\nIf upgrading is not possible, this particular browser's bug can be mitigated by preventing any HTTP request with a `Content-Type` header containing `message/` from reaching Apollo Server (e.g. in a proxy or middleware).\n\nFor example, when using Apollo Server's Express integration, something like this can be placed *before* attaching `expressMiddleware` to the `app`:\n\n```js\napp.use((req, res, next) => {\n  for (let i = 0; i < req.rawHeaders.length - 1; i += 2) {\n    if (\n      req.rawHeaders[i].toLowerCase() === 'content-type' &&\n      req.rawHeaders[i + 1].includes('message/')\n    ) {\n      return res.status(415).json({ error: 'Content-Type not allowed' });\n    }\n  }\n  next();\n});\n```\n\nWhile the patch prevents a broader class of similar issues, the only known way to exploit this vulnerability is against a particular browser which currently plans to ship a fix in May 2026. If it is already past June 2026 and this vulnerability has not been addressed yet, it is likely that the system is not currently vulnerable. Upgrading to the latest version of Apollo Server is still recommended for the broader protection.\n\n## Resources\n\nThe browser bug causes a similar vulnerability in Apollo Router; see https://github.com/apollographql/router/security/advisories/GHSA-hff2-gcpx-8f4p","references":[{"reference_url":"https://github.com/apollographql/apollo-server","reference_id":"","reference_type":"","scores":[{"value":"6.3","scoring_system":"cvssv4","scoring_elements":"CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:L/SI:N/SA:N"},{"value":"MODERATE","scoring_system":"generic_textual","scoring_elements":""}],"url":"https://github.com/apollographql/apollo-server"},{"reference_url":"https://github.com/apollographql/apollo-server/commit/ada12001c4e95b5c779d80314a5a32e33087b5cf","reference_id":"","reference_type":"","scores":[{"value":"6.3","scoring_system":"cvssv4","scoring_elements":"CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:L/SI:N/SA:N"},{"value":"MODERATE","scoring_system":"generic_textual","scoring_elements":""}],"url":"https://github.com/apollographql/apollo-server/commit/ada12001c4e95b5c779d80314a5a32e33087b5cf"},{"reference_url":"https://github.com/apollographql/apollo-server/releases/tag/@apollo/server@5.5.0","reference_id":"","reference_type":"","scores":[{"value":"6.3","scoring_system":"cvssv4","scoring_elements":"CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:L/SI:N/SA:N"},{"value":"MODERATE","scoring_system":"generic_textual","scoring_elements":""}],"url":"https://github.com/apollographql/apollo-server/releases/tag/@apollo/server@5.5.0"},{"reference_url":"https://github.com/apollographql/apollo-server/security/advisories/GHSA-9q82-xgwf-vj6h","reference_id":"","reference_type":"","scores":[{"value":"6.3","scoring_system":"cvssv4","scoring_elements":"CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:L/SI:N/SA:N"},{"value":"MODERATE","scoring_system":"generic_textual","scoring_elements":""}],"url":"https://github.com/apollographql/apollo-server/security/advisories/GHSA-9q82-xgwf-vj6h"},{"reference_url":"https://github.com/apollographql/router/security/advisories/GHSA-hff2-gcpx-8f4p","reference_id":"","reference_type":"","scores":[{"value":"6.3","scoring_system":"cvssv4","scoring_elements":"CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:L/SI:N/SA:N"},{"value":"MODERATE","scoring_system":"generic_textual","scoring_elements":""}],"url":"https://github.com/apollographql/router/security/advisories/GHSA-hff2-gcpx-8f4p"},{"reference_url":"https://www.apollographql.com/docs/apollo-server/previous-versions","reference_id":"","reference_type":"","scores":[{"value":"6.3","scoring_system":"cvssv4","scoring_elements":"CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:L/SI:N/SA:N"},{"value":"MODERATE","scoring_system":"generic_textual","scoring_elements":""}],"url":"https://www.apollographql.com/docs/apollo-server/previous-versions"},{"reference_url":"https://github.com/advisories/GHSA-9q82-xgwf-vj6h","reference_id":"GHSA-9q82-xgwf-vj6h","reference_type":"","scores":[],"url":"https://github.com/advisories/GHSA-9q82-xgwf-vj6h"}],"fixed_packages":[],"aliases":["GHSA-9q82-xgwf-vj6h"],"risk_score":null,"exploitability":null,"weighted_severity":null,"resource_url":"http://public2.vulnerablecode.io/vulnerabilities/VCID-hkjc-51h1-a7h8"}],"fixing_vulnerabilities":[{"url":"http://public2.vulnerablecode.io/api/vulnerabilities/37284?format=json","vulnerability_id":"VCID-8pqt-88h6-xfc5","summary":"Prevent logging invalid header values\n## Impact\n### What kind of vulnerability is it?\nApollo Server can log sensitive information (Studio API keys) if they are passed incorrectly (with leading/trailing whitespace) or if they have any characters that are invalid as part of a header value.\n\n### Who is impacted?\nUsers who (all of the below):\n* use either the schema reporting or usage reporting feature\n* use an Apollo Studio API key which has invalid header values\n* use the default fetcher (`node-fetch`) or configured their own `node-fetch` fetcher\n\nThe following node snippet can test whether your API key has invalid header values. This code is taken directly from `node-fetch@2`'s header value validation code.\n```js\nconst invalidHeaderCharRegex = /[^\\t\\x20-\\x7e\\x80-\\xff]/;\nif (invalidHeaderCharRegex.test('<YOUR_API_KEY>')) {\n  console.log('potentially affected');\n}\nconsole.log('unaffected');\n```\n\nIf the provided API key is not a valid header value, whenever Apollo Server uses that API key in a request (to Studio, for example), `node-fetch` will throw an error _which contains the header value_. This error is logged in various ways depending on the user's configuration, but most likely the console or some configured logging service.\n\n### Patches\nThis problem is patched in the latest version of Apollo Server as soon as this advisory is published.\n\n### Workarounds\n* Try retrieving a new API key from Studio. Note: this may not work if the invalid character is not part of the secret (it may be derived from identifiers like graph name, user name).\n* Override the `fetcher` \n* Disable schema reporting and/or usage reporting\n\n### Solution\n* Apollo Server will now call `.trim()` on incoming API keys in order to eliminate leading/trailing whitespace and log a warning when it does so.\n* Apollo Server will now perform the same validation of API keys as `node-fetch@2` performs on header values on startup. Apollo Server will throw an error on startup (i.e., fail to start completely) and notify the user their API key is invalid along with the offending characters.","references":[{"reference_url":"https://github.com/apollographql/apollo-server","reference_id":"","reference_type":"","scores":[{"value":"LOW","scoring_system":"generic_textual","scoring_elements":""}],"url":"https://github.com/apollographql/apollo-server"},{"reference_url":"https://github.com/apollographql/apollo-server/commit/2c8106c433c4add4b43e2e2b2f5c5c4887b17314","reference_id":"","reference_type":"","scores":[{"value":"LOW","scoring_system":"generic_textual","scoring_elements":""}],"url":"https://github.com/apollographql/apollo-server/commit/2c8106c433c4add4b43e2e2b2f5c5c4887b17314"},{"reference_url":"https://github.com/apollographql/apollo-server/commit/d38b43bac88acdef4295759d7dcc3d4c348d9575","reference_id":"","reference_type":"","scores":[{"value":"LOW","scoring_system":"generic_textual","scoring_elements":""}],"url":"https://github.com/apollographql/apollo-server/commit/d38b43bac88acdef4295759d7dcc3d4c348d9575"},{"reference_url":"https://github.com/apollographql/apollo-server/security/advisories/GHSA-j5g3-5c8r-7qfx","reference_id":"","reference_type":"","scores":[{"value":"LOW","scoring_system":"generic_textual","scoring_elements":""}],"url":"https://github.com/apollographql/apollo-server/security/advisories/GHSA-j5g3-5c8r-7qfx"},{"reference_url":"https://github.com/advisories/GHSA-j5g3-5c8r-7qfx","reference_id":"GHSA-j5g3-5c8r-7qfx","reference_type":"","scores":[],"url":"https://github.com/advisories/GHSA-j5g3-5c8r-7qfx"}],"fixed_packages":[{"url":"http://public2.vulnerablecode.io/api/packages/70227?format=json","purl":"pkg:npm/apollo-server-core@2.26.1","is_vulnerable":true,"affected_by_vulnerabilities":[{"vulnerability":"VCID-hkjc-51h1-a7h8"}],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:npm/apollo-server-core@2.26.1"},{"url":"http://public2.vulnerablecode.io/api/packages/70225?format=json","purl":"pkg:npm/apollo-server-core@3.12.1","is_vulnerable":true,"affected_by_vulnerabilities":[{"vulnerability":"VCID-hkjc-51h1-a7h8"}],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:npm/apollo-server-core@3.12.1"}],"aliases":["GHSA-j5g3-5c8r-7qfx","GMS-2023-2117","GMS-2023-2129"],"risk_score":null,"exploitability":null,"weighted_severity":null,"resource_url":"http://public2.vulnerablecode.io/vulnerabilities/VCID-8pqt-88h6-xfc5"}],"risk_score":null,"resource_url":"http://public2.vulnerablecode.io/packages/pkg:npm/apollo-server-core@3.12.1"}