# Rust-proof your code with our new Testing Handbook chapter

DevFeed: [Rust-proof your code with our new Testing Handbook chapter](<https://devfeed.tech/articles/rust-proof-your-code-with-our-new-testing-handbook-chapter-7658.md>)

Original publisher: [Read original article](<https://blog.trailofbits.com/2026/07/13/rust-proof-your-code-with-our-new-testing-handbook-chapter/>)

Author: "Paweł Płatek"

Published: 2026-07-13T11:00:00Z

Content type: tutorial

Language: en

Sources: [The Trail of Bits Blog](<https://devfeed.tech/sources/the-trail-of-bits-blog.md>), [The Trail of Bits Blog](<https://devfeed.tech/sources/the-trail-of-bits-blog-2.md>)

Topics: [Rust](<https://devfeed.tech/topics/rust.md>), [Security](<https://devfeed.tech/topics/security.md>), [mutation-testing](<https://devfeed.tech/topics/mutation-testing.md>), [Tooling](<https://devfeed.tech/topics/tooling.md>), [Test coverage](<https://devfeed.tech/topics/coverage.md>), [Memory Safety](<https://devfeed.tech/topics/memory-safety.md>), [Rust formal verification](<https://devfeed.tech/topics/rust-formal-verification.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [Claude Code](<https://devfeed.tech/topics/claude-code.md>), [Claude](<https://devfeed.tech/topics/claude.md>)

Tags: [application-security](<https://devfeed.tech/tags/application-security.md>), [claude-code](<https://devfeed.tech/tags/claude-code.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [measurement](<https://devfeed.tech/tags/measurement.md>), [memory-safety](<https://devfeed.tech/tags/memory-safety.md>), [mutation-testing](<https://devfeed.tech/tags/mutation-testing.md>), [rust](<https://devfeed.tech/tags/rust.md>), [security](<https://devfeed.tech/tags/security.md>), [testing](<https://devfeed.tech/tags/testing.md>), [testing-handbook](<https://devfeed.tech/tags/testing-handbook.md>), [tooling](<https://devfeed.tech/tags/tooling.md>)

## AI overview

A new Testing Handbook chapter presents techniques for security testing Rust programs and systems. It covers Rust security limitations, dynamic and static analysis, undefined-behavior detection with Miri, property testing, coverage and mutation testing, Clippy, manual code review, memory zeroization, model checking with Kani, and dependency supply-chain vetting. The article also announces rust-review, a Claude Code plugin for automated Rust security reviews.

## Source excerpt

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. fn main() {(|f:&dyn Fn(u128)->Box< dyn Iterator<Item= char>+'static>|f(*[&( 0x7B736D70683F73u128<<64| 0x7A6A6D7C3F7A667D),&(0x7B736Du128 <<64|0x70683F7073737A77)][((std::hint:: black_box(0.0f64)/0.0).to_bits()>>63)as usize]) .for_each(|c|print!("{c}")))(Box::leak(Box::new(|n: u128|Box::new(std::iter::successors(Some(n),|&n|Some(n>>8) ).take_while(|&n|n>0).map(|n|((n as u8)^0x1F)as char))as _)))} 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. Beyond tooling, the chapter also covers what we've learned from auditing Rust codebases directly. Our gotchas and footguns checklist is a great reference for manual code reviews, and will help you find subtle issues like a & b == c having different operator precedence than in C. The memory zeroization section offers three solutions to the tricky problem of guaranteeing that secrets are erased from memory. Finally, the specialized testing sections cover tools like Kani (a model checker), and the supply chain section covers the full toolchain for vetting dependencies. Still oxidizing We've also released rust-review, a Claude Code plugin for automated Rust security reviews. Co-built with Aptos Labs, it targets over a dozen bug classes, from memory safety and concurrency hazards to FFI pitfalls and async cancellation issues. It's a fast wa