Checkpoint.Unmarshal accepts non-canonical base64 roots; C2SP now requires rejecting them
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
阅读 log/checkpoint.go 第 68 行附近的代码,并检查 base64.StdEncoding.DecodeString 如何处理非规范的 root 编码。issue 提议采用严格解码,并可选择重新编码,以确保行具有精确的规范性;请将该行为与报告中引用的 C2SP 要求进行比较。完成标准是拒绝非规范的 root,同时仍能解析规范的 checkpoint。
由索引模型根据 Issue 内容生成。
描述
log/checkpoint.go line 68 decodes the root line with base64.StdEncoding.DecodeString.
Go's default decoder ignores non-zero trailing bits, so ...Kjg= and ...Kjh= both
decode to the same 32 bytes and both parse as the same checkpoint.
As of C2SP/C2SP#370 (merged 2026-10-01, closing C2SP/C2SP#348) tlog-checkpoint and
signed-note say: "Encoders MUST generate canonical base64 according to RFC 4648,
Section 3.5, and decoders MUST reject non-canonical encodings."
Measured 2026-09-21 over the tlog-witness add-checkpoint interface against
transparency-dev/witness @55a5a0b: it cosigned both spellings of one root at size 25.
The two notes are byte-different, each carries a valid log signature, and each now carries
a witness cosignature. A log can collect a quorum across the two forms; a monitor keyed on
checkpoint bytes sees two checkpoints for one tree state. Reproduction:
https://github.com/MarkovianProtocol/witness-gauntlet (case "non-canonical base64 root").
Fix is one call: base64.StdEncoding.Strict().DecodeString(...), which rejects non-zero
trailing bits (missing padding is already an error in StdEncoding). Go's decoder still
skips CR and LF even in strict mode, so a re-encode-and-compare closes that last gap if you
want the line to be exactly one spelling. Happy to send the PR if you'd rather not.
Markovian Protocol
- 主要语言
- Go
- 星标
- 14
- 派生
- 13
- 平均合并
- 2 天 7 小时
- 30 天内合并 PR
- 10
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
相似的 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 2 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
seaweedfs/seaweed-block#443 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
version-fox/vfox#825 ·
维护者通常 1 天内回复
-
HTTP `batch.Send` returns nil and inserts no rows when the block does not encode可能已有人在做 @Indian-boult 今天认领。 未关闭bug queries
难度 2/5 1-3 小时 新手友好度 72/100
ClickHouse/clickhouse-go#2155 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 82/100
维护者通常 1 天内回复