1
0
mirror of synced 2026-10-24 12:59:22 +03:00
Files
cosign/cmd
Hayden 3e82f50a28 Verification bypass via public key in legacy bundle (GHSA-fx35-mq7g-6g98) (#5041)
Backport of #5040

Remove the fallback that loaded a raw public key from a legacy bundle's cert field when X.509 certificate parsing failed. Previously, an attacker could supply a bare public key in b.Cert to populate co.SigVerifier, skipping X.509 certificate chain validation and CheckCertificatePolicy enforcement during keyless verification. This would use the key without any additional checks. The key-as-certificate in the bundle would take priority over a key being provided via --key as well.

This updates the attest-blob code paths to never set a key in the certificate field in the legacy bundle. sign-blob does not already.

For verification, verify-blob and verify-blob-attestation have been updated to not fallback to parsing a certificate as a key. If a bundle is supplied that contains a key, it fails with a parsing error.

Note that no change is needed for sign/attest and
verify/verify-attestation, as the container signing path never stored a public key in the certificate field and the container verification path would only load a certificate as a certificate.

Signed-off-by: Hayden <8418760+Hayden-IO@users.noreply.github.com>
2026-08-05 19:44:20 -04:00
..
2023-05-31 16:59:32 +00:00