Skip to content
STIMSMITH

Directed graybox fuzzing

Technique WIKI v1 · 6/24/2026

Directed graybox fuzzing (DGF) is a fuzzing technique that steers the generation of test inputs toward specific target locations or conditions in a program, rather than indiscriminately maximizing overall code coverage. Unlike purely coverage-guided graybox fuzzing, which aims to broadly exercise new branches, directed graybox fuzzing prioritizes exploration of designated code regions and (in stateful settings) designated program states, allocating testing resources where vulnerabilities are more likely to occur. The technique has been applied across domains including hardware processor verification and, more recently, smart-contract testing, where stateful directed graybox fuzzing must consider both code and contract state spaces simultaneously.

Directed graybox fuzzing

Overview

Directed graybox fuzzing (DGF) is a fuzzing paradigm in which the fuzzer uses lightweight instrumentation feedback, as in graybox fuzzing, but uses that feedback to direct the search toward predefined targets in the program under test rather than to maximize overall code coverage. This orientation makes DGF particularly suitable for regression testing of known bugs, targeted security audits, and scenarios where only a subset of the program is of interest.

Relationship to coverage-guided graybox fuzzing

Classical graybox fuzzers (e.g., AFL-style approaches) use branch or edge coverage as feedback and reward inputs that discover new coverage. Directed graybox fuzzing inverts this priority: coverage feedback is still used (hence "graybox"), but the fitness function biases the search toward a target set of program locations instead of uniformly expanding coverage. Coverage-guided fuzzers applied to stateful programs can waste resources on benign code regions and can struggle to explore the full state space because they lack effective state-space feedback.

Stateful directed graybox fuzzing

When the system under test is stateful, such as a smart contract, naive directed fuzzing over the code space alone is insufficient. A stateful directed graybox fuzzer must jointly direct the search over:

  • Code Targets — program locations identified via static analysis and pattern matching as more prone to vulnerabilities.
  • State Targets — contract states identified by a scalable backward analysis as states that must be reached for the code targets to be exercised.

Inputs and executions are then prioritized using a fitness metric that combines feedback from both the code space and the state space, so that the fuzzer allocates effort toward regions where vulnerabilities are likely and avoids wasting time on benign areas.

Applications

Hardware / processor verification

Hardware fuzzing for RTL and processor designs has explored directed and coverage-directed approaches. Coverage-directed fuzz testing of RTL on FPGAs (RFUZZ) and related work use coverage signals to guide input generation for hardware designs. Directed techniques in this domain target specific microarchitectural or ISA-level behaviors of interest.

Smart-contract vulnerability detection

Stateful directed graybox fuzzing has been instantiated for smart-contract analysis. A representative system introduces Code Targets (derived from static analysis and pattern matching for vulnerability-prone constructs) and State Targets (derived from a scalable backward analysis that propagates state requirements back from the code targets). A fitness metric integrating code-space and state-space feedback is consumed inside the fuzzing loop. Empirically, this stateful DGF approach has been reported to outperform state-of-the-art coverage-guided fuzzers in both effectiveness and efficiency for smart-contract vulnerability detection, addressing two key limitations of coverage-guided approaches on stateful programs: (i) lack of effective state-space feedback, and (ii) wasted effort on benign code regions.

Limitations of coverage-guided fuzzing that motivate DGF

  • Stateful programs: coverage signals do not capture the contract state space, so coverage-guided fuzzers can fail to reach vulnerable states.
  • Resource wastage on benign code: aiming for comprehensive coverage can spend disproportionate time in safe regions; this is exacerbated when code and state spaces must both be explored.

Key concepts

Concept Description
Directed Search biased toward a predefined target set rather than uniform coverage.
Graybox Uses lightweight instrumentation feedback rather than full program analysis or source.
Stateful directed Extends DGF to stateful programs by directing over both code locations and program states.
Code Target A program location prioritized because static analysis or pattern matching flagged it as vulnerability-prone.
State Target A program state required to reach a Code Target, identified by backward analysis.
Fitness metric Score combining code-space and state-space feedback used to prioritize inputs in the fuzzing loop.

References (cited)

  • Vulseye: Detect Smart Contract Vulnerabilities via Stateful Directed Graybox Fuzzing (arXiv 2408.10116v1).
  • Laeufer et al. RFUZZ: coverage-directed fuzz testing of RTL on FPGAs, ICCAD 2018 (cited as a coverage-directed hardware fuzzer).

CITATIONS

4 sources
4 citations
[1] Coverage-guided fuzzers can lack effective state-space feedback and waste resources on benign code, motivating stateful directed graybox fuzzing. Vulseye: Detect Smart Contract Vulnerabilities via Stateful Directed Graybox Fuzzing
[2] Stateful directed graybox fuzzing introduces Code Targets and State Targets with a fitness metric that leverages feedback from both code space and state space. Vulseye: Detect Smart Contract Vulnerabilities via Stateful Directed Graybox Fuzzing
[3] Static analysis and pattern matching are used to pinpoint Code Targets, and a scalable backward analysis algorithm is used to specify State Targets. Vulseye: Detect Smart Contract Vulnerabilities via Stateful Directed Graybox Fuzzing
[4] Coverage-directed fuzz testing of RTL on FPGAs has been explored as a directed/coverage-directed approach to hardware fuzzing. DATA 2024 proceedings (ChatFuzz paper, references RFUZZ and related hardware fuzzers)