TL;DR
Locus introduces an agentic framework that automatically synthesizes and refines intermediate program predicates—acting as semantic "milestones"—to guide directed fuzzing. By combining Large Language Models (LLMs) with rigorous program analysis and symbolic execution, Locus allows fuzzers to terminate unpromising execution paths early, achieving massive speedups (up to 214×) and uncovering nine previously unknown zero-day vulnerabilities.
What Problem Does This Paper Address?
Directed Grey-box Fuzzing (DGF) is a powerful security testing technique designed to steer program execution toward a specific target state, such as a suspected vulnerability or a newly patched code block. However, reaching these targets is notoriously difficult because they are often deeply nested within complex codebases.
Traditional DGF approaches rely on control-flow graph (CFG) distance metrics to guide the fuzzer. Unfortunately, this feedback is often too sparse or indirect. For example, if a bug requires a specific sequence of optional data chunks to be parsed first, multiple parallel parsing branches might appear equidistant from the target in the CFG, leaving the fuzzer with no clear direction.
Recently, researchers have tried using LLMs to generate input grammars or fuzzing harnesses. However, forcing an LLM to reason all the way from a deep program bug back to the raw input format creates an immense cognitive burden, frequently resulting in hallucinations or unverifiable code that can stall fuzzing progress.
Methods
Locus shifts the strategy from input-level constraints to arbitrary program-point predicates. Instead of rewriting the input harness, Locus injects lightweight if statements into the codebase that act as preconditions for reaching the target. If an execution violates a predicate, it is safely early-terminated.
To automate this, Locus uses an Agentic Synthesizer-Validator Workflow:
- Localization & Generation: An LLM agent explores the codebase using a specialized toolset (including call graphs, reference graphs, and code search tools). It identifies intermediate states necessary to reach the target and generates a candidate predicate.
- Iterative Refinement: The agent attempts to "bubble up" the predicate closer to the program entry point. Moving the check earlier allows the fuzzer to reject invalid inputs faster.
- Dual-Stage Validation:
- Syntax Validation: The framework attempts to compile the instrumented code, feeding any compiler errors back to the agent for self-repair.
- Semantic Validation: Locus uses symbolic execution (via KLEE) combined with reachability pruning to formally prove that the predicate is a strict relaxation of the target state. This ensures the predicate never causes false rejections (i.e., it won't accidentally block an input that could have reached the bug).
Datasets
The authors evaluated Locus using:
- The Magma Benchmark: A ground-truth fuzzing benchmark containing 8 widely used open-source C libraries (such as
libpng,libtiff,openssl, andphp) and spanning 10 distinct vulnerability types. - Real-World Targets: Well-fuzzed open-source projects including
VLC,libming,libarchive, andtcpreplayto test zero-day bug discovery. - Cross-Language Evaluation: Publicly reported vulnerabilities in Python, Go, and Java to demonstrate the framework's language generality.
Key Insights and Ideas
- Local Context Over Global Context: By constraining the LLM to generate localized predicates rather than end-to-end input harnesses, Locus dramatically reduces the context window and reasoning depth required by the model.
- Best-Effort Guidance with Hard Guarantees: Locus treats the LLM's code reasoning as a "best-effort" generator for optimization, but relies on formal symbolic execution as a strict validator. This elegantly bridges the gap between the creative reasoning of LLMs and the rigorous correctness required for program analysis.
- The Power of Early Termination: Fuzzers spend an immense amount of time executing deep paths that have zero chance of hitting the target. Injecting verified early-exit predicates acts as a force multiplier for existing fuzzing algorithms.
Key Results
- Massive Speedups: When integrated with four state-of-the-art directed fuzzers, Locus achieved an average 70.3× speedup in Time-to-Exposure (TTE), with a peak speedup of 214.2× for
SelectFuzz. - Boosting Coverage-Guided Fuzzers: Even when applied to standard coverage-guided fuzzers like
AFL++, it yielded an average 13× speedup. - Zero-Day Discoveries: Locus successfully uncovered nine previously unpatched vulnerabilities in highly scrutinized projects like VLC and libarchive, including memory leaks, use-after-free bugs, and out-of-bounds accesses.
- Language Agnostic: Preliminary tests mutating Python and Go programs showed average fuzzing speedups of 2.6× and 4.5×, respectively.
Limitations and Future Work
- Path Explosion in Validation: While Locus uses reachability pruning to optimize symbolic execution during validation, complex loops between the synthesized predicate and the target canary can still trigger path explosion, causing validation timeouts.
- LLM Dependency: The quality of the predicates depends heavily on the underlying LLM's reasoning capabilities. While Locus proved robust across models like
o3-mini,DeepSeek-R1, andGemini 2.0 Flash, smaller open-weight models might struggle. - Future Directions: The authors suggest exploring LLM-driven loop invariant reasoning and automated function summaries to further alleviate symbolic execution bottlenecks during validation.
Summary updated