address-sanitizer
AddressSanitizer detects memory errors during fuzzing. Use when fuzzing C/C++ code to find buffer overflows and use-after-free bugs.
npx skills add trailofbits/skills --skill address-sanitizer --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# AddressSanitizer (ASan) AddressSanitizer (ASan) is a widely adopted memory error detection tool used extensively during software testing, particularly fuzzing. It helps detect memory corruption bugs that might otherwise go unnoticed, such as buffer overflows, use-after-free errors, and other memory safety violations. ## Overview ASan is a standard practice in fuzzing due to its effectiveness in identifying memory vulnerabilities. It instruments code at compile time to track memory allocations and accesses, detecting illegal operations at runtime. ### Key Concepts | Concept | Description | |---------|-------------| | Instrumentation | ASan adds runtime checks to memory operations during compilation | | Shadow Memory | Maps 20TB of virtual memory to track allocation state | | Performance Cost | Approximately 2-4x slowdown compared to non-instrumented code | | Detection Scope | Finds buffer overflows, use-after-free, double-free, and memory leaks | ## When to Apply **Apply this technique when:** - Fuzzing C/C++ code for memory safety vulnerabilities - Testing Rust code with unsafe blocks - Debugging crashes related to memory corruption - Running unit tests where memory errors are su
- Overview
- Key Concepts
- When to Apply
- Quick Reference
- Step-by-Step
- Step 1: Compile with ASan
- Step 2: Configure ASan Options
- Step 3: Run Your Program
- Step 4: Adjust Fuzzer Memory Limits
- Common Patterns
- Pattern: Basic ASan Integration
- Pattern: ASan with Unit Tests
- Advanced Usage
- Tips and Tricks
clang -fsanitize=address -g -o my_program my_program.c export ASAN_OPTIONS=verbosity=1:abort_on_error=1:detect_leaks=0 clang -o fuzz_target fuzz_target.c clang -fsanitize=address -g -o fuzz_target fuzz_target.c gcc -o test_suite test_suite.c -lcheck gcc -fsanitize=address -g -o test_suite test_suite.c -lcheck clang -fsanitize=address,undefined -g -o fuzz_target fuzz_target.c afl-fuzz -m none -i input_dir -o output_dir ./fuzz cargo fuzz run fuzz_target --sanitizer=address honggfuzz -i input_dir -o output_dir -- ./fuzz_target_asan
What does the address-sanitizer skill do?
AddressSanitizer detects memory errors during fuzzing. Use when fuzzing C/C++ code to find buffer overflows and use-after-free bugs.
How do I install it?
Run `npx skills add trailofbits/skills --skill address-sanitizer --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From trailofbits/skills, a repository with 6,426 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
