Skip to content

fix(core): bind extension catalog commit field to attestation source digest - #636

Merged
jimhoyd merged 2 commits into
mainfrom
claude/bind-catalog-commit-to-attestation
Sep 24, 2026
Merged

jimhoyd merged 2 commits into
mainfrom
claude/bind-catalog-commit-to-attestation

Conversation

@jimhoyd

@jimhoyd jimhoyd commented Sep 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • The extension bundle and artifact catalogs (packages/core/src/extension-bundles.ts, extension-artifacts.ts) carry a commit field, but nothing compared it against the commit the signed GitHub attestation actually vouches for. It was format-checked (40-char hex) and recorded into the lockfile, but not bound to the attestation's own provenance -- a catalog with a truthful signature but a false commit label would have installed without complaint.
  • Bind it, using gh attestation verify --source-digest, which GitHub CLI enforces against the certificate's cert-derived source digest (populated by the OIDC token, not the build script, so it can't be forged by whatever produced the catalog):
    • packages/core/src/extension-transport.ts: attest() now takes an optional commit and, when given, appends --source-digest <commit>; added peekCatalogCommit(), a bounded pre-parse of just the catalog's commit field so it can be handed to the same attest call that verifies the catalog's own signature/signer-workflow/tag (fail-closed only -- a tampered peek just makes that call refuse).
    • packages/core/src/extension-bundles.ts / extension-artifacts.ts: the catalog fetch is now bound via peekCatalogCommit, and once the catalog's commit is confirmed, every subsequent bundle/artifact asset attestation for that release is bound to that same confirmed commit.
    • scripts/verify-extension-bundles.ts (the release-side check that mirrors the CLI's install policy) binds the same way.
  • Added regression tests in test/extension-bundles.test.ts and test/extension-artifacts.test.ts: a catalog whose commit field disagrees with the "true" attested commit (simulated via a fake transport standing in for gh's unforgeable source-digest check) is refused, and a matching catalog installs normally with both the catalog and asset attestations bound to the same commit. Also added a transport-level test proving createGithubTransport's attest() appends --source-digest only when a commit is supplied.
  • Updated docs/EXTENSIONS.md, docs/RELEASE-SECURITY.md and the RIM-EXT-BUNDLE-001 card in docs/RUNTIME-IMPLEMENTATION.md to describe the binding instead of just "the catalog pins its commit".

Fixes #577 per the triage decision: verification confirmed the binding did not exist before this change (checked packages/core/src/extension-transport.ts and scripts/verify-extension-bundles.ts).

Test plan

  • npm run typecheck
  • node --test test/extension-bundles.test.ts test/extension-artifacts.test.ts (includes new [Bug]: verify that bundle/artifact catalog commit fields are bound to the attested commit #577 regression tests, all pass)
  • npm run check (lint, code checks, docs checks including regenerated llms-full.txt)
  • npm run verify (full suite: 840 tests, 2 unrelated flaky failures in test/cli.test.ts and test/provider-verification.test.ts that pass individually in isolation -- confirmed unrelated to this change, both touch CLI process-spawning/deployment-probe timing, not extension bundles/artifacts)
  • Merged latest origin/main in (picked up the RELEASE-OPERATIONS.md doc split and extension-bundle-release.ts refactor; no conflicts in the touched runtime files)

Closes #577

🤖 Generated with Claude Code

jimhoyd and others added 2 commits September 23, 2026 22:28
…digest

The extension-bundles.ts and extension-artifacts.ts catalogs carry a `commit`
field, but nothing compared it against the commit the signed GitHub
attestation actually vouches for -- it was format-checked and recorded, not
verified provenance. Bind it: peek the catalog's own `commit` field ahead of
its full parse and pass it as `gh attestation verify --source-digest` on the
catalog's own attestation, then bind every subsequent asset attestation for
that release to the same confirmed commit. A mismatch now fails closed instead
of being trusted as an unverified label (#577).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ommit-to-attestation

# Conflicts:
#	docs/RELEASE-SECURITY.md
#	llms-full.txt
@jimhoyd
jimhoyd merged commit f08540d into main Sep 24, 2026
21 checks passed
@jimhoyd
jimhoyd deleted the claude/bind-catalog-commit-to-attestation branch September 24, 2026 03:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: verify that bundle/artifact catalog commit fields are bound to the attested commit

1 participant