Hardening JavaScript Programs against LLM-Based Vulnerability Detection
Zhenhao Tian, Jintong Yu, Jingwei Feng, Jianwei Zhuge, Penghui Li
Key points
From the paper's conclusion- We evaluate AntiAgent on real-world JavaScript applications against four detection agents, including Claude Code and Codex.
Abstract
JavaScript programs are often distributed as source code, so attackers can analyze them for vulnerabilities. LLM-based vulnerability detection agents now make this analysis much easier. To mitigate this emerging threat, we present AntiAgent, a defense that lets developers harden their programs against such detection agents. AntiAgent transforms a program before release to impede an agent's analysis. To find effective transformations, AntiAgent evolves a corpus of programs with known vulnerabilities and traces how a detection agent analyzes each evolved version. It keeps the versions on which the agent misses or misreports the vulnerability and extracts their transformations into reusable rules. To protect a new program, AntiAgent carefully divides the task between an LLM and the rules, so that the transformations adapt to the program while preserving its semantics. We evaluate AntiAgent on real-world JavaScript applications against four detection agents, including Claude Code and Codex. AntiAgent reduces the number of vulnerabilities that each agent detects by 52.0-60.7%, outperforming the conventional obfuscator JS-Obfuscator and the LLM-based transformation method FPA on every agent. The transformed programs pass all project tests, indicating that AntiAgent preserves the original program semantics. The transformation rules also remain effective on vulnerability types absent from the corpus and on programs written in another language like Python.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Exploring Automated Vulnerability Identification in JavaScript Code Using Large Language ModelsarXiv · 2026
- Evaluating Inference-Time Defenses Against Package Hallucination in LLM-Generated CodearXiv · 2026
- Deobfuscation of JavaScript code and identification of security weaknesses through large language modelsFuture Generation Computer Systems · 2025
- Sifting the Noise: A Comparative Study of LLM Agents in Vulnerability False Positive FilteringProceedings of the ACM on Software Engineering · 2026
- Self-Evolving Static Analysis via LLM Pseudo-LabelingarXiv · 2026
- OBsmith: LLM-Powered JavaScript Obfuscator TestingProceedings of the ACM on Programming Languages · 2026