Add Security Considerations to spec and cryptographic chain verification#8
Merged
bradleygauthier merged 3 commits intomainfrom Mar 8, 2026
Merged
Conversation
Add CPS Section 7 (Security Considerations) documenting what the protocol provides and does not provide, including signer key compromise, chain truncation, verification levels, replay, and timestamp trust. Extend chain.verify() in both Python and TypeScript with optional cryptographic verification: recompute SHA3-256 from content and verify Ed25519 signatures. Default structural-only behavior is unchanged (backward compatible). Update CHANGELOG to reflect all additions since v1.2.0.
The tamper-detection tests were modifying in-memory capsule objects, but chain.verify() re-reads from SQLite (getting fresh copies), so it never saw the tampering. Fix by writing tampered JSON directly to the database's data column without updating the stored hash.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
chain.verify()in both Python and TypeScript with optional cryptographic verification: recompute SHA3-256 from content and (Python) verify Ed25519 signatures. Default structural-only behavior is unchanged (backward compatible).Type of Change
Checklist
Python reference (
reference/python/)cd reference/python && pytest tests/cd reference/python && ruff check src/ tests/cd reference/python && mypy src/qp_capsule/cd reference/python && pytest tests/test_golden_fixtures.pyTypeScript reference (
reference/typescript/)cd reference/typescript && npm testcd reference/typescript && npx tsc --noEmitcd reference/typescript && npm run conformanceGeneral
Protocol Impact
New Section 7 shifts URI Scheme to Section 8. No changes to serialization, hashing, or sealing — golden fixtures remain valid.