stacklok / stacklok/toolhive-core

verifier: simple-signing payload digest binding is not independently validated

Open
#198 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs-triage
Dominant language
Go
Stars
2
Forks
4
Avg merge
1d 12h
Merged PRs (30d)
46

Description

Surfaced during review of #197 (pre-existing, applies to both keyless and key-signed flows — filing separately as requested there).

container/verifier's bundle reconstruction never parses the simple-signing payload's critical.image.docker-manifest-digest. Both the bundle's MessageDigest and the verification policy's artifact digest derive from the registry-supplied layer.Digest.Hex, so sigstore-go's digest cross-check is tautological: it proves the signature covers the payload layer, but not that the payload's embedded manifest digest matches the artifact actually being verified (CWE-354 / OWASP A08:2021).

Exploitation requires registry compromise (serving a signature manifest whose payload binds a different artifact digest), but this package is becoming the trust anchor for ToolHive's skill verification (stacklok/toolhive#5899), so the binding should be validated explicitly:

  • parse the simple-signing payload JSON after signature verification,
  • compare critical.image.docker-manifest-digest against the digest of the artifact under verification,
  • fail closed on mismatch or unparsable payload.

Refs: #192, #197, sigstore.go's getSimpleSigningLayersFromSignatureManifest / getBundleMsgSignature.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect the bundle reconstruction in container/verifier and the sigstore.go entry points getSimpleSigningLayersFromSignatureManifest and getBundleMsgSignature. Trace the verified simple-signing payload, then validate its critical.image.docker-manifest-digest against the artifact digest; done means mismatched or unparsable payloads fail closed for both keyless and key-signed flows.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.