Artemis: Toward Accurate Detection of Server-Side Request Forgeries through LLM-Assisted Inter-procedural Path-Sensitive Taint Analysis

Yuchen Ji, Ting Dai, Zhichao Zhou, Yutian Tang, Jingzhu HeProc. ACM Program. Lang 2025 · DOI

TL;DR

This paper introduces ARTEMIS, a novel static analysis tool that significantly improves the detection of Server-Side Request Forgery (SSRF) vulnerabilities in PHP web applications. By leveraging LLMs for source/sink identification and incorporating advanced taint analysis techniques, ARTEMIS achieves higher accuracy and detects more vulnerabilities than existing tools, including newly discovered ones.

What Problem Does This Paper Address?

Server-Side Request Forgery (SSRF) is a critical vulnerability in web applications, allowing attackers to trick servers into making unintended requests to internal or external resources. This can lead to sensitive data leakage, unauthorized access, and even remote code execution. While static analysis tools exist for detecting vulnerabilities, they often struggle with PHP's dynamic nature, missing SSRF vulnerabilities due to limitations in identifying third-party libraries, handling implicit function calls, and accurately modeling complex data flows and path conditions. Existing tools also suffer from high false positive rates.

Methods

ARTEMIS employs a multi-faceted approach to address these challenges:

  • LLM-Assisted Source and Sink Identification: ARTEMIS uses a Large Language Model (LLM), specifically GPT-40, to identify both built-in and third-party functions that can act as sources (user input) or sinks (server-side requests). This significantly expands the detection scope beyond what manual or rule-based methods can achieve.
  • Statically Inferred Inter-procedural Call Graph Construction: ARTEMIS builds a comprehensive call graph that accounts for PHP's dynamic features, including implicit calls through magic methods, variable class names, and variable method names. This ensures that taint propagation paths are not prematurely terminated.
  • Augmented Rule-Based Taint Analysis: The tool uses refined taint propagation rules that go beyond generic operations, incorporating array-specific rules and safety string assurance rules to prevent over-tainting and under-tainting. It also models implicit data flows.
  • Path-Sensitive False Positive Pruning: ARTEMIS analyzes path conditions to eliminate infeasible tainted paths. This involves extracting and evaluating conditions within branches and checks that might prevent SSRF exploitation, thus reducing false positives.
  • LLM-Assisted Exploit Generation: To validate findings, ARTEMIS uses an LLM to automatically generate concrete SSRF exploits, significantly reducing manual effort.

Datasets

  • Target Applications: 250 PHP web applications were used for evaluation. This dataset includes:
  • 55 applications with known SSRF CVEs.
  • 195 popular open-source PHP applications sampled from GitHub and the WordPress plugin repository.
  • Ground Truth for Source/Sink Identification: A manually curated set of 7,406 third-party APIs classified as sources, sinks, or neither.

Key Insights and Ideas

  • The Power of LLMs for Source/Sink Identification: LLMs can effectively augment static analysis by identifying a much broader range of potential sources and sinks, especially from third-party libraries, which are crucial for accurate SSRF detection.
  • Implicit Calls are Critical: Ignoring implicit function calls (e.g., magic methods) leads to significant false negatives. ARTEMIS's ability to model these is a key differentiator.
  • Path Conditions Matter for Accuracy: Simply identifying a tainted path isn't enough; understanding the conditions that allow or prevent exploitation is vital for reducing false positives and achieving high precision.
  • LLMs for Exploit Generation Streamline Validation: Automating exploit generation with LLMs dramatically speeds up the process of confirming vulnerabilities and reduces the need for specialized human expertise.

Key Results

  • High Detection Rate: ARTEMIS detected 207 true vulnerable paths, corresponding to 106 true SSRFs.
  • Novel Vulnerability Discovery: 35 of the detected SSRFs were newly discovered and reported to developers, with 24 confirmed and assigned CVE IDs.
  • Low False Positives: ARTEMIS reported only 15 false positives, achieving a precision rate of 93.2%.
  • Outperforms Existing Tools: ARTEMIS significantly outperformed five other static analysis tools (RIPS, PHPJOERN, TCHECKER, PSALM, PHAN) in terms of both the number of detected SSRFs and precision. For example, it detected up to 5 times more SSRFs than some tools.
  • Impact of Components: Ablation studies showed that each component (third-party sources/sinks, implicit call graph construction, rule-based taint analysis, false positive pruning) contributes significantly to ARTEMIS's performance.

Limitations and Future Work

  • Second-Order SSRF: ARTEMIS currently cannot detect second-order SSRFs where user input is stored in a database and later retrieved. This requires modeling database APIs, inferring schemas, and tracking data across database interactions.
  • Dynamic PHP Features: Support for advanced dynamic PHP features like argument unpacking and nested arrays is still limited.
  • Complex Branching and User-Defined Sanitizers: ARTEMIS struggles with certain complex conditional logic and user-defined sanitization functions that remove characters from tainted strings, sometimes leading to false positives.
  • Future Work: The authors suggest extending ARTEMIS to handle database interactions, more dynamic PHP features, and exploring more advanced techniques like static symbolic execution for complex sanitization scenarios.

Summary updated

BibTeX
@article{ji2025artemis,
  author = {Yuchen Ji and Ting Dai and Zhichao Zhou and Yutian Tang and Jingzhu He},
  title = {{Artemis: Toward Accurate Detection of Server-Side Request Forgeries through LLM-Assisted Inter-procedural Path-Sensitive Taint Analysis}},
  journal = {Proc. ACM Program. Lang},
  year = {2025},
  doi = {10.1145/3720488},
}
Figure