zeroize-audit

Detects missing or compiler-eliminated zeroization of secrets in C, C++, and Rust code.

Updated Jul 28, 2026
One-click install
npx skills add https://github.com/IagoPrandi/zeroclaw-plugin --skill zeroize-audit-iagoprandi
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: zeroize-audit
Source: https://github.com/IagoPrandi/zeroclaw-plugin/tree/main/.claude/skills/solana-dev/ext/trailofbits/plugins/zeroize-audit/skills/zeroize-audit
Command: npx skills add https://github.com/IagoPrandi/zeroclaw-plugin --skill zeroize-audit-iagoprandi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Sensitive data such as cryptographic keys, passwords, and tokens often remains in memory because developers forget to zeroize it, or because compilers silently remove wipe calls through dead-store elimination. This Skill audits source code, LLVM IR, and assembly to find these leaks with hard evidence. ## Core Features & Use Cases - Source and compiler-level detection: Identifies 11 finding categories including missing zeroization, partial wipes, insecure heap allocation, register spills, and stack retention, backed by IR diffs and assembly excerpts. - Multi-agent pipeline with PoC validation: Coordinates 11 agents across 8 phases that generate, compile, and run proof-of-concept programs to confirm each finding is actually exploitable. - Use Case: Before releasing a Rust crypto library, run the audit against the crate to verify that every secret buffer uses zeroize::Zeroize and that no wipe is optimized away at -O2, receiving a structured findings.json and final-report.md. ## Quick Start Audit the C codebase at ./src using its compile_commands.json and report any secrets that are not securely zeroized.

Frequently Asked Questions about zeroize-audit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect if memset is optimized away by the compiler?▼

Compare LLVM IR emitted at -O0 versus -O1 and -O2 for the translation unit. If the wipe stores or llvm.memset call present at O0 disappear at higher optimization levels, dead-store elimination removed the wipe; replace it with explicit_bzero, memset_s, or a volatile wipe loop.

How to audit Rust code for missing zeroization of secrets?▼

Provide the path to Cargo.toml and ensure cargo check passes with a nightly toolchain available. The audit analyzes MIR, LLVM IR, and assembly to verify zeroize::Zeroize, Zeroizing<T>, or ZeroizeOnDrop usage and detects copies of secrets lacking tracked wipes.

What tools are needed to run a zeroization audit on C code?▼

You need a compile_commands.json generated from a clean build (via CMake with CMAKE_EXPORT_COMPILE_COMMANDS=ON or Bear), clang on PATH for IR and assembly emission, and uvx if Serena MCP semantic analysis is desired. Missing prerequisites cause defined fail-fast or downgrade behavior.

Does the audit work without Serena MCP available?▼

Yes, when mcp_mode is set to prefer, the audit continues without MCP but downgrades SECRET_COPY, MISSING_ON_ERROR_PATH, and NOT_DOMINATING_EXITS findings to needs_review confidence. With mcp_mode=require, the run stops if MCP is unreachable.

Why does the audit require IR or assembly evidence for some findings?▼

Findings like OPTIMIZED_AWAY_ZEROIZE, STACK_RETENTION, and REGISTER_SPILL describe compiler and machine-level behavior that cannot be proven from source alone. The audit enforces non-negotiable evidence requirements, such as an IR diff showing the wipe present at O0 but absent at O2.

What are the limitations of zeroize-audit for Rust findings?▼

Proof-of-concept generation for Rust supports only MISSING_SOURCE_ZEROIZE, SECRET_COPY, and PARTIAL_WIPE via cargo test; other Rust categories are marked poc_supported=false. AArch64 assembly analysis is experimental and its findings require manual verification.