Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS1qNWczLTVjOHItN3FmeM4AA1lN

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):

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

Solution

Permalink: https://github.com/advisories/GHSA-j5g3-5c8r-7qfx
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS1qNWczLTVjOHItN3FmeM4AA1lN
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Low
Classification: General
Published: 8 months ago
Updated: 8 months ago


Identifiers: GHSA-j5g3-5c8r-7qfx
References: Repository: https://github.com/apollographql/apollo-server
Blast Radius: 0.0

Affected Packages

npm:apollo-server-core
Dependent packages: 531
Dependent repositories: 76,434
Downloads: 4,645,899 last month
Affected Version Ranges: < 2.26.1, >= 3.0.0, < 3.12.1
Fixed in: 2.26.1, 3.12.1
All affected versions: 1.0.2, 1.1.0, 1.1.3, 1.1.5, 1.1.6, 1.1.7, 1.2.0, 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.3.6, 1.4.0, 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.0.6, 2.0.7, 2.1.0, 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.2.4, 2.2.5, 2.2.6, 2.2.7, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.4.4, 2.4.6, 2.4.7, 2.4.8, 2.5.0, 2.5.1, 2.6.0, 2.6.1, 2.6.2, 2.6.3, 2.6.4, 2.6.5, 2.6.6, 2.6.7, 2.6.8, 2.6.9, 2.7.0, 2.7.1, 2.7.2, 2.8.0, 2.8.1, 2.8.2, 2.9.0, 2.9.1, 2.9.2, 2.9.3, 2.9.4, 2.9.5, 2.9.6, 2.9.7, 2.9.8, 2.9.9, 2.9.10, 2.9.11, 2.9.12, 2.9.13, 2.9.14, 2.9.15, 2.9.16, 2.10.0, 2.10.1, 2.11.0, 2.12.0, 2.13.0, 2.13.1, 2.14.0, 2.14.1, 2.14.2, 2.14.3, 2.14.4, 2.14.5, 2.15.0, 2.15.1, 2.16.0, 2.16.1, 2.17.0, 2.18.0, 2.18.1, 2.18.2, 2.19.0, 2.19.1, 2.19.2, 2.20.0, 2.21.0, 2.21.1, 2.21.2, 2.22.0, 2.22.1, 2.22.2, 2.23.0, 2.24.0, 2.24.1, 2.25.0, 2.25.1, 2.25.2, 2.25.3, 2.25.4, 2.26.0, 3.0.0, 3.0.1, 3.0.2, 3.1.0, 3.1.1, 3.1.2, 3.2.0, 3.3.0, 3.4.0, 3.4.1, 3.5.0, 3.6.0, 3.6.1, 3.6.2, 3.6.3, 3.6.4, 3.6.5, 3.6.6, 3.6.7, 3.6.8, 3.7.0, 3.8.0, 3.8.1, 3.8.2, 3.9.0, 3.10.0, 3.10.1, 3.10.2, 3.10.3, 3.10.4, 3.11.0, 3.11.1, 3.12.0
All unaffected versions: 2.26.1, 2.26.2, 3.12.1, 3.13.0
npm:@apollo/server
Dependent packages: 329
Dependent repositories: 5,993
Downloads: 4,016,013 last month
Affected Version Ranges: < 4.9.3
Fixed in: 4.9.3
All affected versions: 4.0.0, 4.0.1, 4.0.2, 4.0.3, 4.0.4, 4.0.5, 4.1.0, 4.1.1, 4.2.0, 4.2.1, 4.2.2, 4.3.0, 4.3.1, 4.3.2, 4.3.3, 4.4.0, 4.4.1, 4.5.0, 4.6.0, 4.7.0, 4.7.1, 4.7.2, 4.7.3, 4.7.4, 4.7.5, 4.8.0, 4.8.1, 4.9.0, 4.9.1, 4.9.2
All unaffected versions: 4.9.3, 4.9.4, 4.9.5, 4.10.0, 4.10.1, 4.10.2, 4.10.3, 4.10.4