go.sum Is Not a Lockfile

2026年1月5日

AI 摘要 AI 生成,可能有误

这篇文章认为 go.sum 并不是锁文件,绝不应该为依赖分析而解析它,因为它只是 Go 校验和数据库(Go Checksum Database)的加密哈希值的本地缓存,对版本解析没有任何影响。相反,go.mod 同时充当清单(manifest)和锁文件,列出所有直接依赖和传递依赖的确切版本(自 Go 1.17 起),从而防止菱形冲突和意外使用未经测试的版本。作者称赞 Go 的模块系统比其他生态系统的“清单加锁文件”设计简单得多、速度也快得多。

I need everyone to stop looking at go.sum, especially to analyze dependency graphs. It is not a “lockfile,”1 and it has zero semantic effects on version resolution. There is truly no use case for ever parsing it outside of cmd/go.

go.sum is only a local cache for the Go Checksum Database. It’s a map of module versions to their cryptographic hashes. Those versions may or may not be in use; it doesn’t matter to package resolution.

go.sum was not even enabled by default in the original modules design, precisely because it has no observable effect on builds!2 Its (important) purpose is exclusively tightening the security story: the Checksum Database ensures the whole ecosystem shares the same contents for a given module version, regardless of how it is downloaded, and go.sum makes that guarantee local and self-contained.

继续阅读全文

为了尊重作者,这里只展示开头几段。你可以去原文阅读,或者在 HorizonReader 里读:划线做笔记、让 AI 帮忙。

更多来自 Filippo Valsorda

The NIST Elliptic Curves Seeds Bounty Has Been Claimed

AI 摘要A team from Anthropic claimed the author's three-year-old bounty by discovering that the NIST elliptic curve seeds were generated in 1997-98 using the drand48 random number generator seeded with UNIX timestamps, disproving the lore that they came from hashed English sentences. The findings rule out the NSA-backdoor conspiracy theories, since the seeds offered too little freedom to intentionally target weak curves, restoring confidence in NIST elliptic curve cryptography. The prize was donated to ISRG, the non-profit behind Let's Encrypt, tripling its value to $36,864.

(Post-Quantum) Cryptographic Right Answers

AI 摘要This article presents an updated edition of the 'Cryptographic Right Answers' guidance for developers, driven by the accelerated post-quantum transition timeline that now targets completion by 2029. It explains that while symmetric cryptography remains largely unchanged, nearly all asymmetric recommendations have shifted, offering concrete picks such as XAES-256-GCM or XChaCha20Poly1305 for encryption, Argon2id or scrypt for passwords, X25519+ML-KEM-768 for key exchange, HPKE with X-Wing for asymmetric encryption, and ML-DSA-44 for signatures. It also highlights that LLM-based code review is now a standard recommendation alongside using memory-safe languages.

Production ML-DSA Verification in 350 Lines of Python

AI 摘要The author presents a production-ready ML-DSA (post-quantum signature) verifier written in 350 lines of pure, dependency-free Python, available on PyPI with an API modeled after pyca/cryptography and support for all parameter sets. Performance is described as decent—around 230 ML-DSA-44 verifications per second, roughly 60x slower than Go—and the implementation is thoroughly tested with Wycheproof vectors, CCTV vectors, and mutation testing. The project originated as a way to validate the author's Go implementation by writing an independent one, and since verification involves no secrets, Python's lack of constant-time guarantees is not a concern.

Opaque, Interoperable Passkey Records (and a Go API)

AI 摘要The article argues that passkeys are the key solution to phishing but that server-side adoption suffers from non-interoperable database schemas, so the author proposes a c2sp.org/passkey-record format—borrowing PHC string syntax and WebAuthn's authenticator data encoding—that lets applications store passkeys as opaque strings, much like password hashes. Building on this, the author drafts a stateless Go crypto/passkey API covering registration and login flows, where the application only stores per-user passkey records and caches login challenges while the library handles verification. The author notes the format naturally avoids credential-ID collision attacks, invites feedback on the format and API (possibly a proposal for Go 1.28), and closes with personal and sponsor notes.

Vulnerability Reports Are Not Special Anymore

AI 摘要The author, a former lead of the Go Security team, explains that vulnerability reports have traditionally been treated as special—deserving responsiveness and attribution—because researchers provided scarce insight and the confidentiality needed to fix flaws before attackers could exploit them. Now that LLMs can find vulnerabilities as well as most researchers, and attackers can do the same, that insight is no longer precious and confidentiality matters little, making triage of noisy reports the real bottleneck. The era of vulnerability reports being special may therefore be over, shifting the job's focus to triage, rapid remediation, and prevention, though the author and commenters note some highly severe or trusted reports may still warrant special treatment.