Skip to content

Validate COSE receipt proof hash sizes#8100

Draft
achamayou wants to merge 1 commit into
mainfrom
achamayou-harden-cose-receipt-proofs
Draft

Validate COSE receipt proof hash sizes#8100
achamayou wants to merge 1 commit into
mainfrom
achamayou-harden-cose-receipt-proofs

Conversation

@achamayou

Copy link
Copy Markdown
Member

Summary

  • Reject COSE receipt write-set digests, claims digests, and Merkle siblings unless they are exactly 32 bytes before copying or fixed-size hash conversion.
  • Repeat exact-size validation during Merkle root recomputation so manually constructed proofs cannot bypass decoder checks.
  • Preserve valid receipt roots, proof directions, commit-evidence hashing, and signature inputs.

This is the standalone memory-safety fix split out of #8092 and has no dependency on its recovery-sidecar changes.

Tests

  • cmake --build build --target cose_test --parallel 4 with CLANG_TIDY=ON
  • ctest --test-dir build -VV -R "^cose_test$" (5 test cases, 184 assertions)
  • scripts/cpp-format-checks.sh -f
  • scripts/includes-checks.sh
  • scripts/copyright-checks.sh
  • scripts/ascii-checks.sh
  • git diff --check

Reject malformed SHA-256 proof components during COSE decoding and defensively before root recomputation. Add focused receipt mutations and manual-proof regressions for exact hash sizes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: acbb0330-193e-4aa1-ad40-dfed15b7d5b1
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.

1 participant