Thinking More, Harnessing Better: State Machine Guided Harness Automatic Generation with Project Digestion and Workflow Decomposition
Summary
SynapseFlow is an automatic fuzz harness generator designed to overcome limitations in existing Large Language Model (LLM)-based methods, which suffer from hallucinations and poor coverage. It introduces dataflow-aware function aggregation and a staged, rollback-enabled generation workflow decomposition. The system analyzes source code to build Structural Flow Graphs and extract coherent Function Triplets, then synthesizes harnesses through a four-stage process managed by a staged rollback algorithm for correctness. Evaluated on 25 real-world open-source projects, SynapseFlow achieved 3.07x, 1.71x, and 4.26x higher branch coverage and 1.77x, 1.51x, and 1.36x higher bug detection rates compared to state-of-the-art tools like OSS-Fuzz-Gen, CKGFuzzer, and PromeFuzz. Notably, it discovered 7 previously unreported bugs, with 5 assigned CVEs.
Key takeaway
For AI Security Engineers or Machine Learning Engineers tasked with automating fuzz harness generation, you should recognize the limitations of monolithic LLM approaches. Implement a structured, multi-stage synthesis workflow that incorporates dataflow analysis for coherent function grouping and a robust rollback mechanism for error mitigation. This strategy, exemplified by SynapseFlow, will significantly improve branch coverage and bug detection rates, leading to the discovery of critical, previously unknown vulnerabilities in your C projects.
Key insights
Decomposed, dataflow-aware LLM workflows with rollback significantly improve fuzz harness generation quality and bug discovery.
Principles
- Decompose complex LLM tasks into verifiable stages.
- Integrate dataflow analysis for coherent function grouping.
- Staged rollback enhances error recovery.
Method
SynapseFlow extracts Function Triplets via dataflow aggregation and Structural Flow Graphs. It then synthesizes harnesses through a four-stage process (documentation, snippet stitching, assembly, optimization) orchestrated by a staged rollback algorithm.
In practice
- Classify function roles using hybrid static analysis and LLMs.
- Apply a three-prompt voting scheme for LLM identification.
- Validate intermediate outputs at each generation stage.
Topics
- Fuzzing
- Harness Generation
- Large Language Models
- Vulnerability Discovery
- Dataflow Analysis
- Workflow Decomposition
Best for: Research Scientist, CTO, VP of Engineering/Data, AI Scientist, AI Security Engineer, Machine Learning Engineer
Related on AIssential
Editorial summary, takeaway, and curation by AIssential. Original article published by cs.SE updates on arXiv.org.