Rust-proof your code with our new Testing Handbook chapter

2026年7月13日

AI 摘要 AI 生成,可能有误

Trail of Bits has added a new chapter to its Testing Handbook offering a comprehensive guide to security testing Rust programs, covering the limits of Rust's guarantees, dynamic analysis tools like Miri and proptest, static analysis with Clippy, audit-derived gotchas, memory zeroization, Kani model checking, and supply chain vetting. The team also released rust-review, a Claude Code plugin co-built with Aptos Labs that automates Rust security reviews across a dozen bug classes. The handbook will be kept current as the Rust ecosystem evolves, and readers are invited to submit PRs with additional tools or gotchas.

We’ve added a new chapter to our Testing Handbook: a comprehensive guide to security testing Rust programs. This chapter covers the tools and techniques we use at Trail of Bits to validate the security of Rust programs and systems.

What’s in the chapter

The chapter starts with a security overview of what Rust’s guarantees do and don’t cover, including underappreciated issues like unwind safety, nondeterminism, and arithmetic errors. This leads into an overview of dynamic analysis, which covers a range of boosters for unit tests, how to use Miri to detect undefined behavior, property testing with proptest, coverage measurement, and mutation testing. The static analysis section then covers Clippy in depth, including a list of our favorite lints.

继续阅读全文

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

更多来自 Trail of Bits Blog

Answering your questions about Anthropic's lattice cryptography results

AI 摘要Anthropic's newly announced quantum algorithms for module lattices raise theoretical concerns about lattice-based cryptography but do not break deployed standards like ML-KEM, ML-DSA, or FN-DSA, since the attacks are asymptotic and impractical at real-world parameter sizes. Implementers are advised to take no immediate action, though cryptographers and standards bodies should study whether the attack could be improved in the future. Other cryptography, including RSA, elliptic curves, and symmetric schemes, is completely unaffected by these results.

After Binance, check what your signing systems can approve

AI 摘要The article examines Binance's October 2026 security incident, in which an attacker obtained valid signatures from the exchange's wallet-signing service via social engineering and stolen credentials, then used an EIP-7702 delegation to repeatedly drain funds without further signatures. It warns that many transaction monitoring and signing-policy systems fail to account for newer Ethereum execution paths such as EIP-7702 delegations, session keys, Safe modules, and ERC-4337 UserOperations, allowing malicious wallet-authority changes to go undetected. The author recommends four measures—reducing access to signing infrastructure, treating delegation as an administrative privilege, limiting damage even if signing is compromised, and detecting wallet-authority changes—each with verification tests to confirm the controls work.

The cryptography behind electronic voting (and why paper ballots are still essential)

AI 摘要The article explains why paper ballots remain essential for elections despite cryptographic advances, describing how systems like Helios and ElectionGuard use techniques such as homomorphic encryption, threshold key-sharing, and zero-knowledge proofs to protect voter privacy and provide verifiable tallies. It highlights that electronic voting introduces unique risks—such as scalable software vulnerabilities, compromised clients, and coercion—that paper-based systems largely avoid through physical controls and detectability of failures. Ultimately, cryptography can strengthen verifiability as a layer atop paper infrastructure, but it cannot fully replace the security and trust of paper ballots in high-stakes public elections.

Backporting security fixes at scale with Codex

AI 摘要The article describes how thousands of known CVEs remain unfixed in stable software like Linux kernel stable branches, Ubuntu LTS, and Debian because backporting security patches is time-consuming, thankless volunteer work that rarely gets prioritized. Using Codex with GPT-5.6, the team reduced backporting effort from days to roughly 30 minutes to three hours of human attention per fix, with AI agents handling patch adaptation, testing, and evidence gathering while engineers review and submit the patches. By October 29, this workflow had helped land fixes for 149 distinct CVEs in stable Linux kernel releases, along with patches for Fedora and Ubuntu packages, demonstrating that AI assistance can make neglected security work practical at scale.

Your AI agent fixed the bug, but what else did it change?

AI 摘要Trail of Bits has released two plugins, patching-bugs and regression-hunt, developed through its Patch the Planet initiative with OpenAI, which let AI agents reproduce reported bugs, develop fixes, and check whether changes break previously working behavior in open-source projects. The plugins standardize patching through strict input/output schemas, live proof-of-concept validation, and project-specific threat models and patching guidelines, with regression-hunt producing 25% fewer false-positive findings than a baseline Codex agent in preliminary evaluations. The authors argue that as AI accelerates bug discovery, the industry needs reliable, standardized patching workflows, and they encourage maintainers to add THREAT_MODEL.md and PATCHING_GUIDELINES.md files so the agents work within each project's rules.