Skip to content

publish: per-architecture manifests are signed but never verified (cosign verify has no --recursive) #925

Closed

Description

@bpalermo

The gap

.github/workflows/publish.yaml signs with --recursive, which covers the index and every child manifest. But it records only one digest per repo:

publish.yaml:199   echo "ghcr.io/${repo}@${digest}" >> signed-images.txt
publish.yaml:235   cosign verify \
publish.yaml:241   done < signed-images.txt

and cosign verify has no --recursive — not in v2.4.1, not in v3.0.6. So the verify step checks eight index digests and nothing else.

Why it matters

The per-architecture manifests are exactly what a puller receives when they pull by an arch-specific digest, which is what any node actually does. Those manifests are signed and never checked, so the verification step does not cover the artifact anyone consumes.

It is not a signing failure — the signatures exist and are correct. It is a coverage gap in the check, which makes the green signal narrower than it reads. Same family as #853, #882 and #906: a gate that passes while covering less than it appears to.

Fix

Enumerate the children from each index and verify each one, the way the signer already walks them. Two details worth knowing before writing it:

  • buildx-produced indexes carry extra unknown/unknown attestation manifests (SBOM/provenance). --recursive signs those too and they verify fine, so they are harmless — but a naive child count will not equal the platform count. rules_img indexes carry only the real platforms.
  • scripts/ghcr-lib.sh (ci(publish): ask the registry whether the commit published, and say so out loud (#880) #913) already resolves index digests and per-repo tags, so the walk probably belongs there rather than inline in the workflow.

Prove it can fail before trusting it: a verify loop that silently iterates zero children would be the same defect one level down.

Provenance

Pre-existing; not introduced by the cosign v3 upgrade (#924), which left it untouched and flagged it. Found while checking a peer session's claim that aether "already verifies each child" — I repeated that claim before checking it, and it is wrong.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

Activity

  1. bpalermo commented on Sep 23, 2026

    @bpalermo
    OwnerAuthor

    The workflow's own comment makes this sharper

    Three lines above the signing step, publish.yaml says:

    --recursive signs the index AND every child manifest. Our images are multi-arch (amd64/arm64), so signing only the index would leave anyone who pulls by per-arch digest with an unsigned manifest.

    So the reasoning was done, explicitly, and applied to signing. The verify loop then reads one index digest per repo from signed-images.txt and cosign verify has no --recursive, so the per-arch manifests that sentence is about are signed and never checked.

    That is not a case of nobody having thought about it. It is the asymmetry surviving right next to the paragraph explaining why it matters — which is what makes it worth a test rather than just a fix.

    Separately: an overclaim in the same comment block

    It is also why rules_img's own signing support (signing_config + rules_img_signer_cosign) cannot be used for this repo — it attaches signatures ONLY as referrers, with no fallback.

    The first half is sourced: rules_img 0.3.21's signing_config docstring says "The signature is then pushed to the image's repository as an OCI referrer."

    "with no fallback" is not sourced. img's referrer push happens in a prebuilt Go binary that is not in the archive, so whether it falls back to an OCI 1.1 fallback tag on a registry that 404s /referrers — which is exactly what ghcr does — cannot be read from what we have. Without a fallback the conclusion holds; with one it does not.

    The conclusion may well be right. The sentence states inference in the same register as the measured /referrers 404s immediately above it, which is the part worth fixing: a future reader cannot tell which half was verified.

    Worth a one-line amendment when someone next touches that block. Surfaced by a peer session that made the same inference in its own repo and caught itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions