GHSA-84MG-GMJF-GV2J
Malicious checkpoint can crash or stall Sigstore bundle verification
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Remediación | Parche 4.1.2 | @sigstore/verify · -100 d desde divulgación | |
| Divulgación | Publicada | GHSA-84MG-GMJF-GV2J divulgada · CVSS 7.5 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
`@sigstore/verify` reads two fields from a transparency log checkpoint without validating them. An attacker controls both fields, and both are read before the checkpoint signature is verified. A crafted bundle can make verification throw an unexpected `SyntaxError` or consume excessive CPU time.
Impact
Any application that verifies Sigstore bundles from untrusted sources with `@sigstore/verify` is affected. This includes applications that use the `sigstore` package. The attacker does not need a valid signature or trusted key material.
The checkpoint in a bundle's `inclusionProof.checkpoint.envelope` causes two problems:
- Regular expression injection. To select a trusted log, `verifySignedNote()` compares the signature name in the checkpoint with the log's base URL using `String.prototype.match()`. That method compiles its argument as a regular expression, so an attacker-supplied name becomes a regular expression. A name such as `(` throws a `SyntaxError`. A nested-quantifier pattern such as `(.*)*x` causes catastrophic backtracking. Against the 25-character subject `https://rekor.sigstore.dev`, `(.*)*x` takes about 19 seconds, and a more deeply nested pattern such as `((((.*)*)*)*)*x` did not finish within 120 seconds. To reach this code, the attacker only needs to set the checkpoint key hint to the first four bytes of a trusted log ID, which are public.
- Unvalidated `BigInt` parsing. `LogCheckpoint.fromString()` passes the second line of the checkpoint note to `BigInt()`. A non-numeric value throws a `SyntaxError`.
In both cases, the error is not a `VerificationError`, the error type documented by `@sigstore/verify`. If your code catches only `VerificationError`, the exception escapes. This can crash the process or bypass error handling. The backtracking case blocks the Node.js event loop, so a single bundle can stall a verifier.
This vulnerability does not bypass signature verification. A malformed bundle cannot make `@sigstore/verify` accept an artifact.
Patches
Fixed in `@sigstore/verify` 4.1.2. The fix compares the checkpoint signature name to the log base URL as a literal substring rather than compiling it as a regular expression. It also converts `BigInt` parse errors in checkpoints and inclusion proofs, and `JSON.parse` errors in transparency log entry bodies, into `VerificationError` instances.
If you depend on `@sigstore/verify` through `sigstore` 5.x, update your lockfile so it resolves `@sigstore/verify` 4.1.2 or later.
Workarounds
Upgrade to the patched version. If you cannot upgrade, verify only bundles from trusted sources. You can also run verification in a worker thread or child process that you can stop after a timeout. Catching the `SyntaxError` prevents that exception from crashing the process, but does not mitigate the backtracking case.
Details
`verifyCheckpoint()` in `packages/verify/src/tlog/checkpoint.ts` handles the checkpoint in this order:
- `SignedNote.fromString()` splits the envelope into a note and signature lines. It captures each signature name with `/— (\S+) (\S+)\n/g`, so a pattern without whitespace can pass through.
- `LogCheckpoint.fromString()` parses the note and calls `BigInt()` on the log size.
- `verifySignedNote()` selects a trusted log by key hint and compares the log base URL with the signature name, then verifies the signature.
The note parsing and log selection both process attacker-controlled input before any signature check passes.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
npm@sigstore/verify |
Corregida | 4.1.2 | -100 d | 4.1.3 no afectada |
4.1.2Arsenal 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-84mg-gmjf-gv2jLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
