agentic-actions-audito…
Audits GitHub Actions workflows for security vulnerabilities in AI agent integrations including Claude Code Action, Gemini CLI,…
Patches past the barriers that stop a fuzzer making progress — checksum and hash verification, magic-value validation, time-based seeds, and other non-deterministic global state. Covers locating the blocking check, neutering it behind a fuzzing build flag, and avoiding the false
Claude Code
$ npx -y skills add trailofbits/skills --skill fuzzing-obstacles --agent claude-code
Codex
$ npx skills add trailofbits/skills --skill fuzzing-obstacles -a codex -y
Cursor
$ npx skills add trailofbits/skills --skill fuzzing-obstacles -a cursor -y
Gemini CLI
$ npx skills add trailofbits/skills --skill fuzzing-obstacles -a gemini-cli -y
GitHub Copilot
$ npx skills add trailofbits/skills --skill fuzzing-obstacles -a github-copilot -y
OpenCode
$ npx skills add trailofbits/skills --skill fuzzing-obstacles -a opencode -y
Windsurf
$ npx skills add trailofbits/skills --skill fuzzing-obstacles -a windsurf -y
name: fuzzing-obstacles type: technique description: "Patches past the barriers that stop a fuzzer making progress — checksum and hash verification, magic-value validation, time-based seeds, and other non-deterministic global state. Covers locating the blocking check, neutering it behind a fuzzing build flag, and avoiding the false positives a patch can introduce. Use when a fuzzer is stuck at validation, when coverage shows large regions behind a checksum, or when valid inputs are impractical to generate."
Codebases often contain anti-fuzzing patterns that prevent effective coverage. Checksums, global state (like time-seeded PRNGs), and validation checks can block the fuzzer from exploring deeper code paths. This technique shows how to patch your System Under Test (SUT) to bypass these obstacles during fuzzing while preserving production behavior.
Many real-world programs were not designed with fuzzing in mind. They may:
These patterns make fuzzing difficult because: 1. **Checksums:** The fuzzer must guess correct hash values (astronomically unlikely) 2. **Global state:** Same input produces different behavior across runs (breaks determinism) 3. **Complex validation:** The fuzzer spends effort hitting validation failures instead of exploring deeper code
The solution is conditional compilation: modify code behavior during fuzzing builds while keeping production code unchanged.
| Concept | Description | |---------|-------------| | SUT Patching | Modifying System Under Test to be fuzzing-friendly | | Conditional Compilation | Code that behaves differently based on compile-time flags | | Fuzzing Build Mode | Special build configuration that enables fuzzing-specific patches | | False Positives | Crashes found during fuzzing that cannot occur in production | | Determinism | Same input always produces same behavior (critical for fuzzing) |
**Apply this technique when:**
**Skip this technique when:**
| Task | C/C++ | Rust | |------|-------|------| | Check if fuzzing build | `#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION` | `cfg!(fuzzing)` | | Skip check during fuzzing | `#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION return -1; #endif` | `if !cfg!(fuzzing) { return Err(...) }` | | Common obstacles | Checksums, PRNGs, time-based logic | Checksums, PRNGs, time-based logic | | Supported fuzzers | libFuzzer, AFL++, LibAFL, honggfuzz | cargo-fuzz, libFuzzer |
Run the fuzzer and analyze coverage to find code that's unreachable. Common patterns:
1. Look for checksum/hash verification before deeper processing 2. Check for calls to `rand()`, `time()`, or `srand()` with system seeds 3. Find validation functions that reject most inputs 4. Identify global state initialization that differs across runs
**Tools to help:**
Modify the obstacle to bypass it during fuzzing builds.
**C/C++ Example:**
// Before: Hard obstacle
if (checksum != expected_hash) {
return -1; // Fuzzer never gets past here
}
// After: Conditional bypass
if (checksum != expected_hash) {
#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
return -1; // Only enforced in production
#endif
}
// Fuzzer can now explore code beyond this check**Rust Example:**
// Before: Hard obstacle
if checksum != expected_hash {
return Err(MyError::Hash); // Fuzzer never gets past here
}
// After: Conditional bypass
if checksum != expected_hash {
if !cfg!(fuzzing) {
return Err(MyError::Hash); // Only enforced in production
}
}
// Fuzzer can now explore code beyond this checkAfter patching:
1. Rebuild with fuzzing instrumentation 2. Run the fuzzer for a short time 3. Compare coverage to the unpatched version 4. Confirm new code paths are being explored
Consider whether skipping the check introduces impossible program states:
If false positives are likely, consider a more targeted patch (see Common Patterns below).
**Use Case:** Hash/checksum blocks all fuzzer progress
**Before:**
uint32_t computed = hash_function(data, size);
if (computed != expected_checksum) {
return ERROR_INVALID_HASH;
}
process_data(data, size);**After:**
uint32_t computed = hash_function(data, size);
if (computed != expected_checksum) {
#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
return ERROR_INVALID_HASH;
#endif
}
process_data(data, size);**False positive risk:** LOW - If data processing doesn't depend
Trail of Bits skills and plugins for AI-assisted security analysis, testing, and development. Install this marketplace in Claude Code or Codex, or import it into your ChatGPT workspace marketplace.
Audits GitHub Actions workflows for security vulnerabilities in AI agent integrations including Claude Code Action, Gemini CLI,…
Understand a codebase before looking for bugs in it - what each function assumes, what it guarantees, and what it depends on…
Scans Algorand smart contracts for 11 common vulnerabilities including rekeying attacks, unchecked transaction fees, missing…
Prepares codebases for security review using Trail of Bits' checklist. Helps set review goals, runs static analysis tools,…
Scans Cairo/StarkNet smart contracts for 6 critical vulnerabilities including felt252 arithmetic overflow, L1-L2 messaging…
Systematic code maturity assessment using Trail of Bits' 9-category framework. Analyzes codebase for arithmetic safety, auditing…
Use for authorized security assessment of REST, GraphQL, WebSocket, or SOAP APIs, including discovery, authentication,…
Extract and decrypt Windows DPAPI-protected secrets (Credential Manager, browser logins/cookies, Wi-Fi credentials, KeePass keys)…
Clean and finalize authorized natural-language text intended for readers by auditing suspicious invisible Unicode and rewriting…