Repository navigation
Reject CRLF and embedded newlines across C2SP parsers and signers - #292
Merged
Merged
Conversation
C2SP specs (tlog-proof@v1, tlog-checkpoint, signed-note, tlog-cosignature, and tlog-policy) require strict LF (\n) line endings and forbid carriage returns (\r) in text bodies, origins, and single-line base64 fields. Previously: - bufio.Scanner with bufio.ScanLines in proof.TLogProof.Unmarshal and witness.Policy.Unmarshal silently stripped \r before \n. - encoding/base64.StdEncoding.DecodeString silently ignores \r and \n, allowing \r on the checkpoint root hash line in log.Checkpoint.Unmarshal and note.formatRFC6962STH, as well as \r or \n in single-line vkey, skey, and note.Signature.Base64 strings. - note.formatEd25519CosignatureV1 and note.formatMLDSACosignatureV1 did not reject \r (or \r/\n in subtree origin and cosigner name). Reject \r across proof.TLogProof.Unmarshal, log.Checkpoint.Unmarshal, witness.Policy.Unmarshal, note.formatEd25519CosignatureV1, and note.formatRFC6962STH; reject \r and \n in note key/signature decoders and note.formatMLDSACosignatureV1; and add test coverage across all affected entry points.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #292 +/- ##
==========================================
+ Coverage 82.57% 89.39% +6.82%
==========================================
Files 5 10 +5
Lines 241 1047 +806
==========================================
+ Hits 199 936 +737
- Misses 30 111 +81
+ Partials 12 0 -12 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
AlCutter
approved these changes
Nov 3, 2026
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.
C2SP specs (tlog-proof@v1, tlog-checkpoint, signed-note, tlog-cosignature, and tlog-policy) require strict LF (\n) line endings and forbid carriage returns (\r) in text bodies, origins, and single-line base64 fields.
Previously:
Reject \r across proof.TLogProof.Unmarshal, log.Checkpoint.Unmarshal, witness.Policy.Unmarshal, note.formatEd25519CosignatureV1, and note.formatRFC6962STH; reject \r and \n in note key/signature decoders and note.formatMLDSACosignatureV1; and add test coverage across all affected entry points.