|
| 1 | +--- |
| 2 | +layout: advisory |
| 3 | +title: 'CVE-2026-31830 (sigstore): sigstore-ruby verifier returns success for DSSE |
| 4 | + bundles with mismatched in-toto subject digest' |
| 5 | +comments: false |
| 6 | +categories: |
| 7 | +- sigstore |
| 8 | +advisory: |
| 9 | + gem: sigstore |
| 10 | + cve: 2026-31830 |
| 11 | + ghsa: mhg6-2q2v-9h2c |
| 12 | + url: https://github.com/sigstore/sigstore-ruby/security/advisories/GHSA-mhg6-2q2v-9h2c |
| 13 | + title: sigstore-ruby verifier returns success for DSSE bundles with mismatched in-toto |
| 14 | + subject digest |
| 15 | + date: 2026-03-11 |
| 16 | + description: | |
| 17 | + ### Summary |
| 18 | +
|
| 19 | + `Sigstore::Verifier#verify` does not propagate the `VerificationFailure` |
| 20 | + returned by `verify_in_toto` when the artifact digest does not match |
| 21 | + the digest in the in-toto attestation subject. As a result, verification |
| 22 | + of DSSE bundles containing in-toto statements returns `VerificationSuccess` |
| 23 | + regardless of whether the artifact matches the attested subject. |
| 24 | +
|
| 25 | + ### Details |
| 26 | +
|
| 27 | + In `lib/sigstore/verifier.rb`, the verify method calls `verify_in_toto` |
| 28 | + (line 176) without capturing or checking its return value: |
| 29 | +
|
| 30 | + `verify_in_toto(input, in_toto)` |
| 31 | +
|
| 32 | + When `verify_in_toto` detects a digest mismatch, it returns a |
| 33 | + `VerificationFailure` object. Because the caller discards this |
| 34 | + return value, execution unconditionally falls through to return |
| 35 | + `VerificationSuccess`. This is the only verification sub-check in |
| 36 | + the method (out of 12) whose failure is not propagated. |
| 37 | +
|
| 38 | + The message_signature code path is not affected. |
| 39 | +
|
| 40 | + ### Impact |
| 41 | +
|
| 42 | + An attacker who possesses a valid signed DSSE bundle containing an |
| 43 | + in-toto attestation for artifact A can present it as a valid attestation |
| 44 | + for a different artifact B. All other verification checks (DSSE envelope |
| 45 | + signature, certificate chain, Rekor inclusion, SCTs, policy) pass because |
| 46 | + they are independent of the artifact content. Only the in-toto subject |
| 47 | + digest check detects the mismatch, and its result is discarded. |
| 48 | +
|
| 49 | + This allows an attacker to bypass artifact-to-attestation binding for |
| 50 | + any consumer that relies on `Sigstore::Verifier#verify` to validate |
| 51 | + DSSE/in-toto bundles. |
| 52 | +
|
| 53 | + ### Workarounds |
| 54 | +
|
| 55 | + None. Consumers cannot work around this without patching the library. |
| 56 | + cvss_v3: 7.5 |
| 57 | + patched_versions: |
| 58 | + - ">= 0.2.3" |
| 59 | + related: |
| 60 | + url: |
| 61 | + - https://nvd.nist.gov/vuln/detail/CVE-2026-31830 |
| 62 | + - https://github.com/sigstore/sigstore-ruby/security/advisories/GHSA-mhg6-2q2v-9h2c |
| 63 | + - https://github.com/advisories/GHSA-mhg6-2q2v-9h2c |
| 64 | +--- |
0 commit comments