Malicious code can hide in LLM agent skill resources, evading detection
VulMask can embed malicious behavior in a skill's auxiliary resources while preserving benign utility and reducing detection rates
Security & privacy arXiv 17 Jun 2026 Attack Prototype evidence
Published as “PhantomSkill: Malicious Code Injection in Agent Skill Ecosystems”
Why it matters
Resource-level vetting and execution-time containment are needed because ordinary-looking vulnerabilities can serve as covert malicious payloads in LLM-based coding agents.
Summary
VulMask, the core technique of PhantomSkill, raises attack success to 58.8% while cutting the warning rate to 11.4%, outperforming prior script-based attacks. It disguises malicious payloads as ordinary CWE-style vulnerabilities in auxiliary resources, evading many coding-agent warnings and malware flags. However, some agents (e.g., Opus-4.7) still detect the masked scripts at high rates and scanners like Snyk flag nearly all masked payloads as malware, so the evasion is not universal.
What they found 3
- VulMask achieves the highest attack success rate (58.8%) and the lowest warning rate (11.4%) among the evaluated methods.
“As shown in Table 1, VulMask achieves the highest ASR (58.8%) while maintaining the lowest warning rate (11.4%) among successful attacks.”
- Compared to the Crazy-Ivan (CI) baseline, VulMask keeps a similar ASR while reducing the warning rate from 27.2% to 11.4%.
“VulMask achieves comparable ASR while reducing the warning rate from 27.2% to 11.4%.”
- For the agent-manipulation goal, VulMask detection drops to 2.9% while maintaining a 60.0% ASR.
“Agent Manipulation 16.7% 2.9% 60.0%”
Caveats 7
- The Opus-4.7 coding agent still detects 90.0% of VulMask-masked scripts.
- Snyk’s static scanner flags 98.9% of masked scripts as malware, showing limited evasion.
- Mondoo does not flag either overt or masked scripts, indicating that some reviewers miss both malicious and vulnerability signals.
- First, our evaluation focuses on representative coding-agent environments and skill ecosystems, but future agent frameworks may adopt different execution models, permission systems, or skill architectures that affect attack effectiveness.
- Second, VulMask currently relies on vulnerability-shaped code generated from a predefined set of CWE-inspired weakness categories.
- Third, although we evaluate multiple LLM backends, and automated reviewers, the results do not cover the full diversity of emerging agent platforms and security tools.
- Finally, our experiments are conducted in controlled environments and may not capture all factors present in real-world deployments.
What’s new here 4
- Masks malicious code as vulnerability-shaped implementations in auxiliary skill resources rather than in textual descriptions.
- Preserves the host skill's advertised functionality while embedding the payload.
- Demonstrates cross-generator transferability of the masking technique.
- Shows that existing automated reviewers often treat the masked code as a benign vulnerability rather than malware.