Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
📦 npm
Not in CISA KEV

GHSA-j5g3-5c8r-7qfx @apollo/server

Fix: apollographql/apollo-server@2c8106c

GHSA-j5g3-5c8r-7qfx is a security vulnerability in @apollo/server. A fix is available for @apollo/server — see the affected versions and patch details below.

Prevent logging invalid header values

Published
Aug 30, 2023
Updated
Aug 30, 2023
Affected
3 pkgs
Patched
3 / 3
Exploits
None indexed
Exploitation data as of Aug 30, 2023 · OSV.dev, FIRST.org (EPSS)

Real-World Exposure

3 pkgs affected

How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.

525other npm packages depend on this — each one inherits the vulnerability until it's patched upstream
@apollo/servernpm
2.0Mdownloads / week
apollo-server-corenpm
576Kdownloads / week

Description

Impact

What kind of vulnerability is it?

Apollo 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.

Who is impacted?

Users who (all of the below):

  • use either the schema reporting or usage reporting feature
  • use an Apollo Studio API key which has invalid header values
  • use the default fetcher (node-fetch) or configured their own node-fetch fetcher

The 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.

const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
if (invalidHeaderCharRegex.test('<YOUR_API_KEY>')) {
  console.log('potentially affected');
}
console.log('unaffected');

If 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.

Patches

This problem is patched in the latest version of Apollo Server as soon as this advisory is published.

Workarounds

  • 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).
  • Override the fetcher
  • Disable schema reporting and/or usage reporting

Solution

  • 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.
  • 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.

Affected Packages

3 total 3 fixed
EcosystemPackageVulnerable rangeFix
📦npm@apollo/serverall versions4.9.3npm install @apollo/server@4.9.3
📦npmapollo-server-core3.0.0&&< 3.12.13.12.1npm install apollo-server-core@3.12.1
📦npmapollo-server-coreall versions2.26.1npm install apollo-server-core@2.26.1

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for @apollo/server, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update @apollo/server to 4.9.3 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-j5g3-5c8r-7qfx is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like GHSA-j5g3-5c8r-7qfx can be triaged on real exposure rather than presence alone.

Tailored to GHSA-j5g3-5c8r-7qfx. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Frequently Asked Questions

## Impact ### What kind of vulnerability is it? Apollo 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. ### Who is impacted? Users who (all of the below): * use either the schema reporting or usage reporting feature * use an Apollo Studio API key which has invalid header values * use the default fetcher (`node-fetch`) or configured their own `node-fetch` fetcher The following node snippet can test whether your API key has invalid header values. Th
O3 Security · Impact-Aware SCA

Is GHSA-j5g3-5c8r-7qfx in your dependencies?

O3 Security finds GHSA-j5g3-5c8r-7qfx across npm dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.

GHSA-j5g3-5c8r-7qfx: @apollo/server | O3 Security