Multi-Agent Taint Specification Extraction for Vulnerability Detection

Jonah Ghebremichael, Saastha Vasan, Saad Ullah, Greg Tystahl, David Adei, Christopher Kruegel, Giovanni Vigna, William Enck, Alexandros KapravelosarXiv 2026 · DOI

Abstract: Static Application Security Testing (SAST) tools using taint analysis are widely viewed as providing higher-quality vulnerability detection results compared to traditional pattern-based approaches. However, performing static taint analysis for JavaScript poses two major challenges. First, JavaScript's dynamic features complicate data flow extraction required for taint tracking. Second, npm's large library ecosystem makes it difficult to identify relevant sources/sinks and establish taint propagation across dependencies. In this paper, we present SemTaint, a multi-agent system that strategically combines the semantic understanding of Large Language Models (LLMs) with traditional static program analysis to extract taint specifications, including sources, sinks, call edges, and library flow summaries tailored to each package. Conceptually, SemTaint uses static program analysis to calculate a call graph and defers to an LLM to resolve call edges that cannot be resolved statically. Further, it uses the LLM to classify sources and sinks for a given CWE. The resulting taint specification is then provided to a SAST tool, which performs vulnerability analysis. We integrate SemTaint with CodeQL, a state-of-the-art SAST tool, and demonstrate its effectiveness by detecting 106 of 162 vulnerabilities previously undetectable by CodeQL. Furthermore, we find 4 novel vulnerabilities in 4 popular npm packages. In doing so, we demonstrate that LLMs can practically enhance existing static program analysis algorithms, combining the strengths of both symbolic reasoning and semantic understanding for improved vulnerability detection.

Introduction: The JavaScript Challenge

Static Application Security Testing (SAST) tools like CodeQL are the industry standard for identifying security flaws. However, they face significant hurdles when analyzing JavaScript. The language's highly dynamic nature—characterized by closures, computed properties, and complex module exports—frequently "breaks" the call graph. When a static analysis tool cannot resolve a function call, it loses the ability to track how data flows from a user input (source) to a dangerous operation (sink).

Dynamic patterns in JavaScript, such as computed property access and dynamic function assignments, often break traditional static analysis call graphs.

Furthermore, the massive npm ecosystem presents a scale problem. Most tools ignore third-party dependencies because they are too large to ingest or lack the manual "specifications" required to understand their data-handling behavior. Consequently, state-of-the-art tools currently miss nearly 70% of known vulnerabilities in npm packages. SemTaint bridges this gap by combining the precision of symbolic reasoning with the semantic "common sense" of LLMs.

The SemTaint Architecture

SemTaint operates as a pipeline of three specialized LLM agents that work in tandem with CodeQL to "repair" the broken links in static analysis. The system architecture is designed to be modular and efficient, invoking the LLM only where traditional symbolic reasoning fails.

The SemTaint system architecture features specialized LLM agents for source/sink identification, call graph repair, and flow summarization, integrated with a CodeQL backend.

1. Source/Sink Agent

Rather than relying on generic, hardcoded lists of dangerous functions, this agent analyzes the package's code alongside MITRE CWE descriptions. It identifies package-specific entry points and risky operations that might be unique to a particular library's API.

2. CallGraph Agent and TICR

This agent acts as a "repairman" for the call graph. When CodeQL encounters a dynamic call it cannot resolve, the agent uses the LLM to determine the likely target. To ensure scalability and cost-effectiveness, SemTaint employs a novel algorithm called Taint-Informed Callee Resolution (TICR). TICR strategically limits LLM queries to only those unresolved calls that appear on a potential path between a known source and a sink, ignoring thousands of irrelevant calls.

3. Flow Summary Agent

This agent inspects third-party libraries (node_modules) on-demand. It determines if a library call propagates "tainted" data or safely sanitizes it, generating a "flow summary." This allows CodeQL to understand dependency behavior without needing to analyze the entire dependency tree.

Evaluation and Key Results

The researchers evaluated SemTaint using a curated set of 957 vulnerabilities in npm packages, specifically focusing on 172 "hard" cases that CodeQL (v2.21.2) was previously unable to detect. Additionally, they analyzed 102 popular real-world npm packages to hunt for zero-day vulnerabilities.

  • Significant Recall Improvement: SemTaint detected 106 out of 162 vulnerabilities previously invisible to CodeQL, marking a 65.43% improvement in recall.
  • Zero-Day Discoveries: The system identified 4 novel vulnerabilities in popular npm packages, which have since been reported to maintainers.
  • Operational Efficiency: By focusing only on security-relevant unresolved calls, TICR reduced the number of required LLM queries by 94.5%, making the approach viable for large-scale production environments.
  • Synergy of Components: An ablation study revealed that while custom source/sink identification was vital, 27% of detections were only possible because the CallGraph Agent successfully repaired broken links in the code.

Discussion and Limitations

SemTaint demonstrates that LLMs can surgically augment static analysis to solve long-standing problems in dynamic language security. However, challenges remain. LLM non-determinism requires mitigation strategies like majority voting, which increases compute costs. Additionally, while SemTaint excels at inter-procedural (between function) analysis, it does not yet address intra-procedural gaps where static analysis might lose track of data within a single function. Future work may involve porting this multi-agent architecture to other dynamic languages like Python and refining sanitizer detection to reduce false negatives.

Summary updated

Abstract

Static Application Security Testing (SAST) tools using taint analysis are widely viewed as providing higher-quality vulnerability detection results compared to traditional pattern-based approaches. However, performing static taint analysis for JavaScript poses two major challenges. First, JavaScript's dynamic features complicate data flow extraction required for taint tracking. Second, npm's large library ecosystem makes it difficult to identify relevant sources/sinks and establish taint propagation across dependencies. In this paper, we present SemTaint, a multi-agent system that strategically combines the semantic understanding of Large Language Models (LLMs) with traditional static program analysis to extract taint specifications, including sources, sinks, call edges, and library flow summaries tailored to each package. Conceptually, SemTaint uses static program analysis to calculate a call graph and defers to an LLM to resolve call edges that cannot be resolved statically. Further, it uses the LLM to classify sources and sinks for a given CWE. The resulting taint specification is then provided to a SAST tool, which performs vulnerability analysis. We integrate SemTaint with CodeQL, a state-of-the-art SAST tool, and demonstrate its effectiveness by detecting 106 of 162 vulnerabilities previously undetectable by CodeQL. Furthermore, we find 4 novel vulnerabilities in 4 popular npm packages. In doing so, we demonstrate that LLMs can practically enhance existing static program analysis algorithms, combining the strengths of both symbolic reasoning and semantic understanding for improved vulnerability detection.
BibTeX
@misc{ghebremichael2026multi,
  author = {Jonah Ghebremichael and Saastha Vasan and Saad Ullah and Greg Tystahl and David Adei and Christopher Kruegel and Giovanni Vigna and William Enck and Alexandros Kapravelos},
  title = {{Multi-Agent Taint Specification Extraction for Vulnerability Detection}},
  year = {2026},
  eprint = {2601.10865},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2601.10865},
}
Figure