GHSA-HRF4-74C9-4HR4
Registry challenge can direct credentialed token requests to arbitrary hosts
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Remediación | Parche 0.8.0 | @sigstore/oci · -8 d desde divulgación | |
| Divulgación | Publicada | GHSA-HRF4-74C9-4HR4 divulgada · CVSS 4.7 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
`@sigstore/oci` sends token requests to whatever URL a registry names in its `WWW-Authenticate` challenge, without validating it. A malicious or compromised registry can make the client send requests to internal services or cloud metadata endpoints that the attacker can't reach directly.
Impact
Any application that uses `@sigstore/oci` to talk to a registry the attacker controls is affected. This includes `sigstore attach` in `@sigstore/cli`. The affected APIs are `getImageDigest` and `attachArtifactToImage`. To exploit it, the attacker must run or compromise the registry, or get the victim to reference an image on it.
When a registry returns `401 Unauthorized`, the `realm` parameter of its `WWW-Authenticate` header names the token endpoint. `@sigstore/oci` requests a token from that URL and sends the registry credentials in a `Basic` `Authorization` header. The client doesn't check the realm's scheme, host, or address range, so the realm can point at `127.0.0.1`, a private network address, or a metadata endpoint such as `169.254.169.254`.
The existing redirect guard doesn't help. `#tokenFetch()` takes the origin that may receive the `Authorization` header from the realm URL itself, so the attacker's chosen host counts as same-origin.
The attack is blind, because the token response isn't returned to the attacker. What the attacker gains is the client's network position. For example, from a CI runner the attacker can send requests to hosts they can't route to themselves.
Patches
Fixed in `@sigstore/oci` 0.8.0. By default, registry, token service, redirect, and blob upload requests now require HTTPS and a public network destination. The client blocks loopback, private, link-local, metadata, multicast, reserved, and documentation addresses, and checks every resolved address before it connects.
This changes default behavior. If you use a registry or token service on a private or local address, list its exact origin in `fetchOpts.allowedPrivateOrigins`, or pass `--allow-private-origin` to `sigstore attach`.
Workarounds
The best fix is to upgrade. If you can't upgrade, use `@sigstore/oci` only with registries you trust. In environments such as CI runners, block outbound access from the client to metadata endpoints and internal services.
Details
`#fetchDistributionToken()` in `packages/oci/src/registry.ts` builds the token URL directly from the challenge:
```ts
const authURL = new URL(challenge.realm);
authURL.searchParams.set('service', challenge.service);
authURL.searchParams.set('scope', challenge.scope);
const tokenResponse = await this.#tokenFetch(authURL.toString(), {
headers: { [HEADER_AUTHORIZATION]: `Basic ${basicAuth}` },
}).then(ensureStatus(200));
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 | -8 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-hrf4-74c9-4hr4Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
