CraftFuzz: Generating Precise Requests for PHP Web Vulnerability Validation

Jiazhen Zhao, Kailong Zhu, Guozheng Yang, Yifan Zhang, Yuliang LuApplied Sciences 2025

TL;DR

This paper introduces CraftFuzz, a novel directed fuzzing approach that combines static and dynamic analysis to precisely validate PHP web vulnerabilities. By intelligently generating targeted requests, CraftFuzz significantly improves the accuracy and efficiency of vulnerability detection, outperforming existing state-of-the-art fuzzers.

What Problem Does This Paper Address?

Web applications are critical infrastructure, but vulnerabilities within them can lead to severe consequences. While static analysis offers broad code coverage for vulnerability detection, it suffers from a high rate of false positives, requiring significant manual effort to confirm. Dynamic analysis, on the other hand, provides accurate reports but often struggles to explore deeper code regions where vulnerabilities are more likely to reside due to limitations in its methodologies. Existing fuzzing tools often fail to generate requests that precisely reach vulnerable code paths, especially in complex PHP applications with dynamic routing and intricate control flow constraints. This gap hinders the effective and efficient validation of vulnerabilities identified by static analysis.

Methods

CraftFuzz employs a multi-stage refinement-solving strategy to overcome these challenges:

  1. Reachability Analysis: This stage leverages static analysis to extract routing rules and file inclusion chains. It then generates precise entry URLs that are more likely to reach the target sink, avoiding inefficient exploration of irrelevant parts of the application.
  2. Path Constraint Solving: CraftFuzz extracts path constraints from basic blocks and control dependencies. It then uses coverage monitoring to track the execution path and performs targeted parameter mutations to satisfy these constraints, ensuring that the fuzzer can navigate complex control flows.
  3. Data Constraint Resolution: For triggering vulnerabilities, CraftFuzz constructs payloads using a defined format and four reflection strategies. An execution monitor verifies if the vulnerability is successfully triggered by observing specific reflective behaviors. If a vulnerability is exploited, a proof-of-concept (PoC) is generated.

Datasets

The authors evaluated CraftFuzz using two datasets:

  • Dataset 1 (Microtest): This dataset consists of 13 microtests, originally from Witcher's work, artificially constructed to evaluate path constraint solving capabilities.
  • Dataset 2 (Real-world applications): This dataset comprises 29 real-world web applications, including those with dynamic routing, selected from previous baseline studies.

Key Insights and Ideas

  • Bridging Static and Dynamic Analysis: The core innovation is the synergistic combination of static analysis (for coverage and constraint extraction) and dynamic analysis (for precise validation), addressing the limitations of each individually.
  • Intelligent Entry URL Generation: CraftFuzz's ability to analyze routing rules and file inclusion chains to generate targeted entry URLs is crucial for efficiently reaching vulnerable code, a significant improvement over generic crawling.
  • Precise Path Constraint Solving: By extracting and satisfying complex path constraints, CraftFuzz can navigate intricate control flows that often trip up simpler fuzzing approaches.
  • Effective Vulnerability Triggering: The use of reflection strategies and an execution monitor ensures that triggered vulnerabilities are genuinely exploitable, reducing false positives.

Key Results

CraftFuzz demonstrated strong performance across various aspects:

  • Entry URL Generation: Achieved a 97.1% success rate, generating 200 out of 206 entry URLs from static analysis reports.
  • Path Constraint Solving: Successfully solved 95% of path constraints, with an average time of 20 seconds per constraint.
  • Known Vulnerability Verification: Validated 88.88% of known vulnerabilities, outperforming state-of-the-art fuzzers by 32.28%.
  • Efficiency: Solved each entry URL and path constraint in an average of 6 and 20 seconds, respectively.

Limitations and Future Work

The authors acknowledge several limitations and propose future directions:

  • File Inclusion Chain Identification: Incomplete identification of file inclusion chains in large-scale applications can lead to URL generation failures. Future work involves introducing a caching mechanism to save program states after unified initialization phases.
  • Unsolvable Built-in Constraints: While CraftFuzz abstracts common PHP built-in functions, a more scalable solution is needed. The authors plan to leverage large language models to automatically extract the semantics of most built-in functions.
  • Constraint-Dependent Program Variables: Currently, path and data constraints are handled independently. When a variable is critical to both, this separation can cause issues. Future work will introduce symbolic execution to solve such variables consistently.

Summary updated

BibTeX
@inproceedings{zhao2025craftfuzz,
  author = {Jiazhen Zhao and Kailong Zhu and Guozheng Yang and Yifan Zhang and Yuliang Lu},
  title = {{CraftFuzz: Generating Precise Requests for PHP Web Vulnerability Validation}},
  booktitle = {Applied Sciences},
  year = {2025},
  doi = {10.3390/app15052579},
}
Figure