llamaCVEVulnerability Intelligence
/
Advisory · GitHub · npm · @apollo/server

GHSA-J5G3-5C8R-7QFX

Prevent logging invalid header values

Parche disponible
Descargar PNG JSON
CVSS
—
low
Fuente: —
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche3 versionesPrimer parche a -314 d de la divulgación
Exposición1.178 dDesde la divulgación, 30 ago 2023, 4:24 p. m.
Detección1.174 dDesde la divulgación hasta su ingreso al índice
Decisión estimadaSeguir
Remediar en la ventana regular de mantenimiento
Estimación de Llama con el árbol SSVC de CISA a partir de la severidad declarada por GHSA (baja) y la evidencia de explotación (sin evaluación oficial): sin explotación conocida, no automatizable e impacto técnico parcial. Hay versiones corregidas disponibles.
Relájate, esto es más bajo que mi siesta.Riesgo bajo: puedes terminar tu café.
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Parche 2.26.1
Parche 4.9.3 +1
Monitoreo
Detectada
20 oct 22
30 ago 23
17 nov 26
21 nov 26
20 oct 22
29 oct 23
5 nov 24
13 nov 25
21 nov 26
FechaFaseEventoDetalle
Remediación Parche 2.26.1 apollo-server-core · -314 d desde divulgación
Divulgación Publicada GHSA-J5G3-5C8R-7QFX divulgada
Remediación Parche 4.9.3 @apollo/server · 0 d desde divulgación
Remediación Parche 3.12.1 apollo-server-core · 0 d desde divulgación
Monitoreo Detectada Ingresó al índice
Resumen
Descripción del advisory
Texto original · GitHub · en inglés

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

Versiones

Rangos afectados

Afectada Corregida Última
apollo-server-core< 2.26.1
@apollo/server< 4.9.3
apollo-server-core≥ 3.0.0 < 3.12.1
2.26.1
3.0.0
3.12.1
3.13.0
4.9.3
5.5.2
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
npm@apollo/server
Corregida 4.9.3 0 d 5.5.2 no afectada
npmapollo-server-core
Corregida 2.26.1, 3.12.1 -314 d · 0 d 3.13.0 no afectada
Versiones corregidas2.26.13.12.14.9.3
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Otrahttps://github.com/apollographql/apollo-server/security/advisories/GHSA-j5g3-5c8r-7qfx
Otrahttps://github.com/apollographql/apollo-server/commit/2c8106c433c4add4b43e2e2b2f5c5c4887b17314
Otrahttps://github.com/apollographql/apollo-server/commit/d38b43bac88acdef4295759d7dcc3d4c348d9575
Otrahttps://github.com/apollographql/apollo-server

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.