GHSA-9MJ6-F434-PGCG
@sigstore/oci forwards OAuth2 password-grant credentials on cross-origin 307/308 redirects
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Remediación | Parche 0.8.0 | @sigstore/oci · -7 d desde divulgación | |
| Divulgación | Publicada | GHSA-9MJ6-F434-PGCG divulgada · CVSS 7.5 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Impact
When `@sigstore/oci` authenticates with identity-token credentials (username `<token>`), it requests a registry token with an OAuth2 password grant. The `POST` body sent to the token endpoint includes `username`, `password`, and `grant_type=password`.
If the token endpoint answers that `POST` with a `307` or `308` redirect to a different origin, the client follows the redirect and re-sends the original body, including the password. The client strips the `Authorization` header on cross-origin redirects, but it doesn't apply equivalent protection to credentials carried in the request body. A `303` redirect isn't affected because it changes the request to a `GET` and drops the body.
Exploitation requires all of the following:
- The client uses `<token>` credentials, so the OAuth2 password-grant flow runs.
- The token endpoint returns a cross-origin `307` or `308` redirect to a destination the attacker controls, for example through an open redirect, misconfiguration, or compromise of the token service.
A malicious registry doesn't need this redirect, because it already chooses the token endpoint through its `WWW-Authenticate` challenge. This issue matters when the registry and its token service are otherwise trusted.
The affected code is in `packages/oci/src/registry.ts` (the OAuth2 token request and the shared redirect loop).
Related hardening
The same report notes that Docker Hub canonicalization in `packages/oci/src/image.ts` uses `endsWith('docker.io')`, so look-alike hosts such as `mydocker.io` are routed to Docker Hub. Credential lookup still requires an exact host match, so this doesn't send credentials to an attacker-chosen host. It is tracked here as a correctness and hardening fix.
Patches
Not yet patched.
Workarounds
- Avoid `<token>` identity-token credentials for registries whose token service may redirect to another origin.
- Prefer short-lived, narrowly scoped registry credentials.
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
npm@sigstore/oci |
Corregida | 0.8.0 | -7 d | 0.8.0 no afectada |
0.8.0Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/sigstore/sigstore-js/security/advisories/GHSA-9mj6-f434-pgcgLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
