Prevent logging invalid header values
Key facts
- Attack vector
- —
- Privileges required
- —
- User interaction
- —
- Attack complexity
- —
- Impact type
- —
- Confidentiality · integrity · availability
- —
- Fix status
- Fixed
No CVSS vector from any source. Fix status from GitHub.
Summary
## 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. ```js 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.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | @apollo/server (npm) | before 4.9.3 | 4.9.3 | Patch available | GHSA-j5g3-5c8r-7qfx |
| — | apollo-server-core (npm) | 3.0.0 to before 3.12.1 | 3.12.1 | Patch available | GHSA-j5g3-5c8r-7qfx |
| — | apollo-server-core (npm) | before 2.26.1 | 2.26.1 | Patch available | GHSA-j5g3-5c8r-7qfx |
- @apollo/server (npm) Vendor— Affected before 4.9.3 Fixed in 4.9.3 Patch available GHSA-j5g3-5c8r-7qfx
- apollo-server-core (npm) Vendor— Affected 3.0.0 to before 3.12.1 Fixed in 3.12.1 Patch available GHSA-j5g3-5c8r-7qfx
- apollo-server-core (npm) Vendor— Affected before 2.26.1 Fixed in 2.26.1 Patch available GHSA-j5g3-5c8r-7qfx
Remediation
- Fix · GHSA-j5g3-5c8r-7qfx @apollo/server (npm) Fixed in 4.9.3 Advisory →
- Fix · GHSA-j5g3-5c8r-7qfx apollo-server-core (npm) Fixed in 3.12.1 Advisory →
- Fix · GHSA-j5g3-5c8r-7qfx apollo-server-core (npm) Fixed in 2.26.1 Advisory →
Timeline
- 2026-10-03 Threatist record created from GHSA-j5g3-5c8r-7qfx
References
Other 4
- https://github.com/apollographql/apollo-server/security/advisories/GHSA-j5g3-5c8r-7qfx
- https://github.com/apollographql/apollo-server/commit/2c8106c433c4add4b43e2e2b2f5c5c4887b17314
- https://github.com/apollographql/apollo-server/commit/d38b43bac88acdef4295759d7dcc3d4c348d9575
- https://github.com/apollographql/apollo-server
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences