VYPR
High severityNVD Advisory· Published Aug 4, 2022· Updated Apr 22, 2025

False positive signature verification in cosign

CVE-2022-35929

Description

cosign is a container signing and verification utility. In versions prior to 1.10.1 cosign can report a false positive if any attestation exists. cosign verify-attestation used with the --type flag will report a false positive verification when there is at least one attestation with a valid signature and there are NO attestations of the type being verified (--type defaults to "custom"). This can happen when signing with a standard keypair and with "keyless" signing with Fulcio. This vulnerability can be reproduced with the distroless.dev/static@sha256:dd7614b5a12bc4d617b223c588b4e0c833402b8f4991fb5702ea83afad1986e2 image. This image has a vuln attestation but not an spdx attestation. However, if you run cosign verify-attestation --type=spdx on this image, it incorrectly succeeds. This issue has been addressed in version 1.10.1 of cosign. Users are advised to upgrade. There are no known workarounds for this issue.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
github.com/sigstore/cosignGo
< 1.10.11.10.1

Affected products

1

Patches

1
c5fda01a8ff3

Merge pull request from GHSA-vjxv-45g9-9296

https://github.com/sigstore/cosignMatt MooreAug 4, 2022via ghsa
1 file changed · +10 1
  • cmd/cosign/cli/verify/verify_attestation.go+10 1 modified
    @@ -201,6 +201,7 @@ func (c *VerifyAttestationCommand) Exec(ctx context.Context, images []string) (e
     			}
     		}
     
    +		var checked []oci.Signature
     		var validationErrors []error
     		for _, vp := range verified {
     			payload, err := policy.AttestationToPayloadJSON(ctx, c.PredicateType, vp)
    @@ -217,6 +218,7 @@ func (c *VerifyAttestationCommand) Exec(ctx context.Context, images []string) (e
     				cueValidationErr := cue.ValidateJSON(payload, cuePolicies)
     				if cueValidationErr != nil {
     					validationErrors = append(validationErrors, cueValidationErr)
    +					continue
     				}
     			}
     
    @@ -225,8 +227,11 @@ func (c *VerifyAttestationCommand) Exec(ctx context.Context, images []string) (e
     				regoValidationErrs := rego.ValidateJSON(payload, regoPolicies)
     				if len(regoValidationErrs) > 0 {
     					validationErrors = append(validationErrors, regoValidationErrs...)
    +					continue
     				}
     			}
    +
    +			checked = append(checked, vp)
     		}
     
     		if len(validationErrors) > 0 {
    @@ -237,10 +242,14 @@ func (c *VerifyAttestationCommand) Exec(ctx context.Context, images []string) (e
     			return fmt.Errorf("%d validation errors occurred", len(validationErrors))
     		}
     
    +		if len(checked) == 0 {
    +			return fmt.Errorf("none of the attestations matched the predicate type: %s", c.PredicateType)
    +		}
    +
     		// TODO: add CUE validation report to `PrintVerificationHeader`.
     		PrintVerificationHeader(imageRef, co, bundleVerified, fulcioVerified)
     		// The attestations are always JSON, so use the raw "text" mode for outputting them instead of conversion
    -		PrintVerification(imageRef, verified, "text")
    +		PrintVerification(imageRef, checked, "text")
     	}
     
     	return nil
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

4

News mentions

0

No linked articles in our index yet.