Exploiting Library Vulnerability via Migration Based Automating Test Generation

Zirui Chen, Xing Hu, Xin Xia, Yi Gao, Tongtong Xu, David Lo, Xiaohu Yang

TL;DR

VESTA (Vulnerability Exploit-based Software Testing Auto-Generator) is a new tool that automatically determines if a project is truly at risk from a third-party library vulnerability. By "migrating" data from known library exploits into automatically generated tests for a specific project, VESTA achieves a 71.7% success rate in reproducing vulnerabilities—a 53.4% improvement over previous state-of-the-art methods.

What Problem Does This Paper Address?

Modern software is a "tower of dependencies," with 96% of projects relying on open-source libraries. When a vulnerability (like the infamous Log4Shell) is disclosed in a library, developers face a difficult question: "Is my project actually exploitable, or is the vulnerable code just sitting there unused?"

Existing solutions fall short:

  1. Static Analysis: Often produces "false alarms" because it can't prove that an attacker can actually reach and trigger the flaw through the project's specific APIs.
  2. Dynamic Analysis: Requires high-quality test cases that exercise the vulnerable path, which many projects lack.
  3. Search-Based Testing: Tools like EvoSuite can generate tests, but they lack the "domain knowledge" (the specific malicious payload) needed to actually trigger a complex security bug.

The authors tackle the challenge of bridging the gap between a library-level bug and a project-level proof-of-concept (PoC).

Methods

The core innovation of VESTA is Exploit Migration. Instead of trying to "guess" how to trigger a bug, it uses the information provided in public vulnerability disclosures (CVEs) as a guide.

The process follows three phases:

  1. Pre-Processing: VESTA uses static analysis to map the "call graph" from the project's public entry points down to the vulnerable library function. It also extracts the "Exploit Value" (the payload) from the library’s original PoC.
  2. Test Generation: Using a genetic algorithm (built on top of EvoSuite), VESTA evolves test cases. Crucially, it uses a modified fitness function. Standard tools only reward "covering" a line of code; VESTA rewards tests that pass values similar to the original exploit payload to the vulnerable function.
  3. Migration & Refinement: Once a test reaches the target function, VESTA "migrates" the exploit payload into the test. It uses rules for type conversion (e.g., turning a String into a ByteArray), string manipulation, and file processing to ensure the payload survives the journey through the project's internal logic.

Datasets

The researchers evaluated VESTA using:

  • 30 Vulnerabilities: Sourced from the last five years across 18 popular Java libraries (including Jackson-databind, Log4j2, and Apache Commons).
  • 60 Project-Vulnerability Pairs: Real-world Java projects from GitHub that depend on these vulnerable libraries.
  • Baseline: They compared VESTA against Transfer, a recent state-of-the-art tool that uses "vulnerability witness tests" to guide generation.

Key Insights and Ideas

  • Reachable $\neq$ Exploitable: Simply proving a path exists from the API to the library isn't enough. Security bugs often require very specific, "malformed" data. VESTA treats the original library PoC as the "source of truth" for this data.
  • The "Exploit Value" is the Secret Sauce: By incorporating the similarity of parameters into the genetic algorithm's fitness score, the tool "nudges" the test generator toward paths that don't just hit the right line, but also preserve the integrity of the malicious input.
  • Leveraging Existing Tests: The authors found that while a project's existing tests might not trigger a bug, they provide excellent "skeletons" for call graphs. VESTA can hijack these existing tests and swap in exploit parameters, which is much faster than generating tests from scratch.

Key Results

  • Effectiveness: VESTA successfully generated exploits for 43 out of 60 project-vulnerability pairs (71.7% success rate). The baseline, Transfer, only managed 11 (18.3%).
  • Efficiency: On average, it took only 22.75 seconds to generate a successful exploit when starting from scratch. If the project already had a test covering the vulnerable function, VESTA could migrate the exploit in just 3.09 seconds.
  • Zero False Positives: In all 30 projects where the library was present but the project logic made the bug unreachable, VESTA correctly reported that no exploit could be generated.

Limitations and Future Work

  • Manual Bottleneck: Currently, a human still needs to identify the "vulnerable function name" from the CVE report to set the search goal.
  • Sandbox Restrictions: VESTA relies on EvoSuite, whose security sandbox sometimes blocks the very file-system or network access needed to prove an exploit (e.g., RCE or Path Traversal).
  • Language Support: The current implementation is limited to Java.
  • LLM Integration: The authors suggest that Large Language Models (LLMs) could eventually be used to automate the extraction of exploit values from messy, natural-language CVE descriptions, further reducing manual effort.

Summary updated

BibTeX
@inproceedings{chen2024exploiting,
  author = {Zirui Chen and Xing Hu and Xin Xia and Yi Gao and Tongtong Xu and David Lo and Xiaohu Yang},
  title = {{Exploiting Library Vulnerability via Migration Based Automating Test Generation}},
  booktitle = {ICSE},
  year = {2024},
  doi = {10.1145/3597503.3639583},
}
Figure