Low

Prevent logging invalid header values

  • Disclosed: 30.08.2023
  • Updated: 11.10.2026 10:22

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.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
npm package @apollo/server < 4.9.3 4.9.3
npm package apollo-server-core >= 3.0.0, < 3.12.1, < 2.26.1 3.12.1, 2.26.1

References

CVSS score -
Weakness (CWE)
-
Platform
npm
Package
@apollo/server, apollo-server-core
Disclosed
30.08.2023
Updated
11.10.2026 10:22

Sources and licenses

OSV / GitHub Advisory Database - GHSA-j5g3-5c8r-7qfx - CC BY 4.0

Vulnerability history: apollo-server-core

All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.

Total entries
5
First → latest
06.2020 03.2026
Without a fix
1
Exploited in attacks
0

Severity breakdown

  • Medium 4
  • Low 1

Disclosures per year

  1. 2020: 1
  2. 2021: 0
  3. 2022: 2
  4. 2023: 1
  5. 2024: 0
  6. 2025: 0
  7. 2026: 1
  1. Prevent logging invalid header values this entry
    Low ghsa-j5g3-5c8r-7qfx >= 3.0.0, < 3.12.1, < 2.26.1 3.12.1, 2.26.1
  2. Medium ghsa-8r69-3cvp-wxc3 >= 3.0.0, < 3.11.0 3.11.0
  3. Medium ghsa-w42g-7vfc-xf37 < 2.14.2 2.14.2

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.