TL;DR
PDFuzzer is a novel fuzzing framework that leverages Large Language Models (LLMs) and SMT solvers to automatically discover zero-day vulnerabilities in PDF JavaScript engines. By extracting semantic specifications and complex inter-API relationships directly from documentation and execution traces, it generates highly sophisticated test sequences that achieved up to 48% higher code coverage than state-of-the-art tools and uncovered 31 zero-day bugs.
What Problem Does This Paper Address?
PDF files aren't just static documents; they frequently embed JavaScript to support interactive features like form validation and dynamic rendering. This means PDF readers must include embedded JavaScript engines, making them prime targets for attackers seeking arbitrary code execution (ACE) or information disclosure.
To find these flaws, security researchers use fuzzing—feeding automated, mutated inputs into a program to make it crash. However, existing PDF fuzzers suffer from three major bottlenecks:
- Undocumented APIs: Over 30% of PDF JavaScript functions are completely undocumented by vendors, leaving massive blind spots for traditional fuzzers.
- Shallow Relationship Modeling: Existing tools only understand simple "producer-consumer" relationships (where the output of function A becomes the input of function B). They miss value-constraint relationships (e.g., two distinct functions requiring the exact same string ID to interact) and implicit relationships (interacting via shared internal state).
- Heavy Manual Effort: Converting hundreds of pages of natural-language documentation into machine-readable fuzzing rules historically required immense human expertise.
Methods
PDFuzzer overcomes these limitations through a clever pipeline that combines the semantic reasoning of LLMs with the mathematical precision of constraint solvers.
The architecture consists of four main stages:
- Dual-Path Specification Extraction: Documented APIs are parsed directly from official manuals using regular expressions. Undocumented APIs are discovered via differential analysis of execution traces, and an LLM is then prompted to infer their full semantic specifications (types, constraints, and behaviors) based on naming conventions and surrounding context.
- Two-Phase Parameter-Level Grammar Generation: Complex APIs can have dozens of parameters, overwhelming LLMs with information and leading to overgeneralized rules. PDFuzzer solves this by decomposing specifications down to individual parameters, prompting the LLM to generate precise Context-Free Grammars (CFGs) for each one independently.
- Two-Stage Relationship Inference: To avoid the $O(n^2)$ computational explosion of comparing every possible pair of APIs, PDFuzzer uses Retrieval-Augmented Generation (RAG) to quickly filter out irrelevant pairs. A second, more powerful LLM pass then analyzes the remaining candidates to extract symbolic constraints and execution order, outputting them as formal SMT-LIB2 expressions.
- Test Case Generation: The framework instantiates the parameter CFGs and feeds the symbolic constraints into the Z3 SMT solver to generate concrete, mathematically valid API call sequences. Finally, it integrates these scripts into valid PDF structures and applies targeted mutations to probe for edge cases.
Datasets
The authors evaluated PDFuzzer against three mainstream, closed-source PDF readers:
- Adobe Acrobat Reader (v24.005.20421)
- Foxit PDF Reader (v2024.4.0.27683)
- PDF-XChange Editor (v10.5.2.395)
To test the framework's generalizability, they also compiled a dataset from Microsoft Word's VBA (Visual Basic for Applications) APIs, extracting specifications from 5,920 pages of official documentation.
Key Insights and Ideas
- LLMs as Translators for Formal Logic: The core "aha" moment is that LLMs are uniquely suited to bridge the gap between ambiguous natural-language documentation and rigid symbolic constraints. Instead of letting the LLM generate code directly (which is slow, expensive, and error-prone), PDFuzzer uses the LLM to extract rules, leaving the actual test case generation to a deterministic SMT solver.
- Fighting Information Overload: Feeding an entire 23-parameter API specification into an LLM causes it to miss fine-grained constraints. Breaking the problem down to the parameter level dramatically improves grammar accuracy (achieving 98% accuracy for parameters).
- Beyond Producer-Consumer: The vast majority of critical bugs require value-coupling or state-dependent ordering. For instance, a Use-After-Free (UAF) bug in Foxit was triggered because
app.popUpMenuExallocated memory using a specific string name, andsearch.queryfreed it using that same name—a value-constraint relationship that traditional fuzzers completely missed.
Key Results
- Vulnerability Discovery: PDFuzzer discovered 31 zero-day vulnerabilities across the three target readers, including 11 high-severity issues capable of Arbitrary Code Execution (ACE). At the time of writing, 26 have been fixed or confirmed, earning the authors $2,450 in bug bounties and 10 CVEs.
- Code Coverage: PDFuzzer consistently outperformed traditional fuzzers (TypeOracle, Favocado, Cooper) and general-purpose LLM fuzzers (Fuzz4All), improving basic block coverage by up to 48%.
- Efficiency and Cost: Compared to a naive LLM approach that directly writes test cases, PDFuzzer is significantly faster (generating up to 20 test cases per second vs. taking over 60 seconds per test case) and operates at a fraction of the API cost ($60–$92 end-to-end).
Limitations and Future Work
While highly effective, PDFuzzer occasionally suffers from LLM hallucinations, particularly when parameter names strongly imply a type that contradicts the actual implementation (e.g., assuming a parameter ending in "Perm" is a Boolean when it actually expects a permission-level string).
Additionally, implicit relationships remain the hardest to successfully instantiate (64% success rate) because they often require complex, state-dependent preconditions that are difficult to satisfy purely through sequential API calls. The authors suggest that incorporating dynamic execution feedback to track reader states could be a promising direction for future work.
Summary updated