Automatic, Expressive, and Scalable Fuzzing with Stitching
The paper introduces STITCH, an automated fuzzing system that combines static typing and dynamic typestate tracking to "stitch" API usage constraints into runtime-assembled sequences, enabling scalable and expressive bug discovery that significantly outperforms state-of-the-art tools in coverage, precision, and the number of new vulnerabilities found.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you are trying to find every possible way a complex machine (like a software library) can break. You have a robot tester (a "fuzzer") whose job is to poke the machine with random inputs to see if it crashes.
The problem is that modern software is like a giant, intricate Lego castle. If you just throw random Lego bricks at it, you'll mostly just knock over the ones that were already loose, or you'll build a pile of junk that doesn't fit together at all. You rarely find the real hidden structural flaws because the robot doesn't know the rules of how the bricks are supposed to snap together.
This paper introduces a new way to teach the robot how to build valid structures so it can find the real cracks. They call this technique "Stitching."
Here is the breakdown using simple analogies:
1. The Problem: The "Random Throw" vs. The "Rulebook"
- Old Way (Fixed Sequences): Imagine a robot that is programmed to always build a specific tower: Brick A, then Brick B, then Brick C. It's fast, but it can only build that one tower. If the real bug happens when you build a bridge (Brick A, then Brick D), the robot never finds it.
- Old Way (Pure Randomness): Imagine a robot that grabs bricks randomly and tries to stick them together. It tries to glue a square peg into a round hole. The machine screams "ERROR!" and crashes, but that's not a real bug in the software; it's just the robot being clumsy. The robot wastes all its time finding "clumsy" errors instead of "structural" ones.
2. The Solution: "Stitching"
The authors propose a middle ground. Instead of giving the robot a fixed recipe or a bag of random bricks, they give it a box of pre-made, valid Lego segments (called "blocks").
- The Blocks: Each block is a tiny, valid piece of code that does one thing correctly (e.g., "Create a Document").
- The Stitching: The robot is allowed to grab these blocks and snap them together in any order it wants, as long as the pieces fit.
- The Magic Glue (Typestate): This is the paper's biggest innovation. Usually, Lego instructions are just about shape (a 2x4 brick fits a 2x4 hole). But real software has rules about state. For example, "You can't paint a wall before you build it," or "You can't open a door if the key is lost."
- The paper adds a "Magic Glue" (called extrinsic typestate) that tracks the history of the objects.
- If the robot tries to glue a "Paint" block onto a "Wall" block that hasn't been built yet, the Magic Glue says, "Whoa, hold on! That wall doesn't exist yet!" and the robot politely stops that specific attempt without crashing the whole machine.
- This allows the robot to explore millions of combinations without wasting time on impossible ones.
3. The Brain: The LLM Agent (STITCH)
Writing these "blocks" and "rules" by hand is hard. It's like trying to write a manual for a spaceship while blindfolded.
Enter STITCH, the system described in the paper. It uses a Large Language Model (an AI that is very good at reading code and documentation) to act as a Super Architect.
- Step 1: The Architect reads the blueprints. The AI scans the software's documentation and code comments to understand the rules.
- Step 2: It builds the blocks. It automatically writes the code for the "Lego segments."
- Step 3: It acts as a Quality Control Inspector. The AI runs the robot. If the robot crashes, the AI looks at the crash and asks, "Did I give the robot a bad rule? Or did I find a real bug?"
- If it was a bad rule, the AI rewrites the rulebook (fixes the specification).
- If it was a real bug, it writes a report for the humans.
4. The Results: Finding the Hidden Cracks
The researchers tested this system on 1,365 different open-source projects (like the software that runs your web browser, video players, and printers).
- The Scorecard: Compared to other top-tier tools, STITCH found 30 real, dangerous bugs while the others combined only found 10.
- The Efficiency: It was much faster and cheaper. While other tools spent hours and thousands of dollars trying to figure out how to test the code, STITCH did it in minutes for pennies.
- Real World Impact: They found 131 new bugs in 102 different projects. Many of these were serious security holes (like a remote hacker taking control of a printer) that had been hiding for years. The maintainers of these projects were thrilled, patching 73 of them immediately.
Summary
Think of Stitching as giving a robot a smart, self-correcting instruction manual instead of a blindfold.
- Without it: The robot is either too rigid (misses new paths) or too clumsy (creates fake errors).
- With it: The robot understands the logic of the software, knows what is allowed and what isn't, and can creatively combine valid steps to find the one specific combination that breaks the machine.
The paper proves that by combining AI (to write the rules) with Stitching (to follow the rules dynamically), we can automatically find software bugs that humans and older tools have missed for years.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.