🛡️ GHSA-j5g3-5c8r-7qfx — apollo-server-core
Description
Prevent logging invalid header values
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 ownnode-fetchfetcher
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@2performs 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 software
GHSA-j5g3-5c8r-7qfx is recorded against 2 packages.
- @apollo/server
- apollo-server-core
Timeline and source
Published on 30 August 2023. No public exploit is currently recorded for this entry. Record sourced from OSV.
References
github.com (Web)
github.com (Web)
github.com (Web)
github.com (Package)
Details
Affected Packages
| Software | From version | Fixed in |
|---|---|---|
| @apollo/server | — | — |
| apollo-server-core | — | — |
References
Similar Threats
- High ROOT-APP-NPM-CVE-2026-23897
- Medium ROOT-APP-NPM-GHSA-9q82-xgwf-vj6h
- High CVE-2026-23897
- Low GHSA-j5g3-5c8r-7qfx
- Low GHSA-68jh-rf6x-836f
Free Vulnerability Check
Is your site affected by GHSA-j5g3-5c8r-7qfx?
BotEraser helps you identify potentially vulnerable plugins and themes by checking your installation against GHSA-j5g3-5c8r-7qfx and other known CVE records.
Scan My Site Free →No credit card required · Results in minutes
ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.