Malicious LLM API routers inject code and steal credentials
Third-party LLM API routers can actively inject malicious payloads and exfiltrate secrets from agents
Security & privacy arXiv 9 Apr 2026 Measurement Real-world evidence
Published as “Your Agent Is Mine: Measuring Malicious Intermediary Attacks on the LLM Supply Chain”
Why it matters
Client-side defenses can lower immediate risk, but full mitigation requires provider-signed response envelopes to guarantee tool-call provenance.
Summary
The paper finds that malicious LLM API routers are already active in the wild, with 9 out of 428 surveyed routers injecting malicious code and 17 exfiltrating researcher credentials. They demonstrate this by purchasing 28 paid routers and collecting 400 free ones, and by running poisoning studies that show even benign routers can be turned into attack vectors via leaked keys. Client-side defenses (a fail-closed policy gate and an anomaly-screening detector) can reduce exposure, but the policy gate can be fully bypassed by adaptive attacks and the detector only catches a subset of payload injections, indicating limited protection without provider-signed response integrity.
What they found 4
- 9 out of 428 routers (1 paid, 8 free) actively inject malicious code, with additional routers performing adaptive evasion and credential theft.
“Across 28 paid routers purchased from Taobao, Xianyu, and Shopify-hosted storefronts and 400 free routers collected from public communities, we find 1 paid and 8 free routers actively injecting malicious code, 2 deploying adaptive evasion triggers, 17 touching researcher-owned AWS canary credentials, and 1 draining ETH from a researcher-owned private key.”
- A fail-closed policy gate blocks all AC-1 and AC-1.a samples with only 1.0% false positives.
“A fail-closed policy gate blocks all AC-1 and AC-1.a shell-rewrite samples at 1.0% false positives, and response-side anomaly screening flags 89% of AC-1 samples without requiring provider changes.”
- The policy gate can be completely bypassed when the attacker uses allow-listed domains or pre-positioned stagers.
“In a simple adaptive benchmark that uses those two strategies, the policy gate is bypassed in 100% of samples.”
- Poisoning studies with a leaked OpenAI key caused 2 B billed tokens, 99 leaked credentials across 440 Codex sessions, and 401 sessions running in autonomous YOLO mode.
“Our measurement of 428 commodity routers found 9 injecting malicious code and 17 abusing researcher-owned credentials; poisoning studies showed that even benign routers are one leaked key away from the same exposure, with researcher-controlled decoys attracting 2B billed tokens, 440 autonomous Codex sessions, and 99 leaked credentials.”
Caveats 4
- The policy gate is bypassed in 100% of samples when the attacker hides behind an allow-listed domain or a pre-positioned local stager.
- Anomaly screening only detects 89% of AC-1 samples and far fewer of the adaptive variants (50% of AC-1.a and 50.9% of AC-1.b).
- Our measurement targets the most active commodity router markets and uses researcher-controlled accounts throughout. Extending the study to private deployments are natural next steps that would complement the snapshot presented here.
- The strongest caveat is that the policy gate is also brittle: once the attacker can hide behind an allowlisted domain or a pre-positioned local stager, the gate no longer helps.
What’s new here 4
- First systematic measurement of malicious behavior in commodity LLM API routers.
- Formal threat model and taxonomy (payload injection, secret exfiltration, adaptive evasion).
- Poisoning studies showing that a single leaked upstream key can compromise otherwise benign routers.
- Evaluation of three deployable client-side defenses and quantification of their coverage.