fix: close signature-verification bypass and harden input validation - #9
Merged
Merged
Conversation
added 2 commits
June 1, 2026 04:39
…alidation Security and correctness fixes from repo audit: - CRITICAL: Check 3 no longer accepts any 64-hex-char string in demo mode. Previously `sigHex.length === 64` was treated as a passing (warn) signature. Demo mode now only warns on an EXACT expected-digest match and fails closed otherwise. - Validate algorithm agreement (registry key + cert issuer must be ed25519) and that the signature is a well-formed 128-char hex string BEFORE attempting Ed25519 verification, instead of letting Buffer.from(...,"hex") silently truncate malformed input. - Check 1 now validates field TYPES of untrusted input (issuer object, causal_chain array, outputs object, signature/merkle_root strings), not just presence, before later checks dereference them. - Make verify.update() encoding explicit (utf8) to match sha256Hex. - CLI version string now read from package.json instead of hardcoded, so it cannot drift on version bump. - Fix malformed .gitignore (literal "\n" replaced with real newlines so node_modules/ and dist/ are actually ignored). dist/ rebuilt from patched source.
…es-HDq24 # Conflicts: # .gitignore # dist/index.js # src/index.ts
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.
Repo audit fixes — causallayer-verifier
Closes a Critical signature-verification bypass plus several correctness/packaging issues found during a code audit.
Critical
sigHex.length === 64), reporting it as a passingwarn. Demo mode now onlywarns on an exact expected-digest match and fails closed otherwise. Verified: a forged cert (unknown key + 64-hex signature) is now rejected with a hardfail.High
ed25519) and that the signature is a well-formed 128-char hex string before attempting Ed25519 verification — instead of lettingBuffer.from(...,"hex")silently truncate malformed input.Medium / Low
verify.update()encoding made explicit (utf8) to matchsha256Hex.package.json(was hardcodedv0.1.0)..gitignore(literal\n→ real newlines, sonode_modules/anddist/are actually ignored).dist/rebuilt from patched source.Not included (need signer-side coordination)
Remote registry trust-pinning, RFC-8785-compliant canonicalization, and Merkle duplicate-leaf domain separation were intentionally left out — changing them alters verification behavior and must be aligned with the signing server.
🤖 Generated during a repository code audit.
Generated by Claude Code