Osegi
Security·2 min read

Malicious AI API routers hijack agents and steal crypto, study finds

Researchers tested 428 third-party API routers that sit between AI agents and models. Some injected malicious code, and one drained a decoy Ethereum wallet.

A router-like box sitting between an AI agent and several AI model providers, with a hooded figure peeking at the data passing through.
Image: ITmedia NEWS

If you point an AI coding agent at a cheap third-party "API router", you are handing a stranger the keys. That is the message of a new paper from researchers at the University of California, Santa Barbara (UCSB) and colleagues, titled "Your Agent Is Mine".

An API router is a service that sits between an agent such as Claude Code or Codex and providers such as OpenAI or Anthropic. It takes the request and forwards it to the right model. As agents write code, run commands and operate cloud environments for people, these middlemen have become common.

Why are API routers risky?

Because users choose the router themselves, the encrypted connection (TLS) ends at the router. Prompts, API keys and the instructions the model sends back are all readable there, and can be rewritten. The researchers also note that today's major AI APIs have no digital signature proving a reply was not altered on the way.

They describe two attacks. In payload injection, the router edits the command the AI returns. It can swap a legitimate URL for one that serves malware, or change a package name to a lookalike (requests becomes reqeustsl). Some routers behaved normally for the first 50 requests and attacked from the 51st, or only struck in fully automatic "YOLO mode" on Rust or Go projects. The second attack changes nothing. It just copies API keys, AWS access keys, GitHub tokens and crypto private keys as they pass through, so victims rarely notice.

What did the 428-router test find?

The team examined 28 paid and 400 free routers. One paid and eight free routers injected malicious code, and two of them used the wait-50-requests trick. For 17 free routers, decoy AWS credentials sent through them were later used by someone. One router emptied a decoy Ethereum private key that held a small deposit.

Honest routers are not automatically safe. If they reuse leaked keys or forward traffic through a weakly secured server, they open the same door. The team's own decoy relay was added to other operators' routing without permission, and 440 development sessions exposed 99 credentials.

Practically: treat any router like a service that can see everything, and avoid sending it secrets you cannot rotate.

Apps worth a look

SUMO: the number puzzle

Tap the right tiles, add them up, hit the target. Easy to learn, hard to master. Free, for all ages.

Tags:api routerai agentsllm securitysupply chain attackucsbcrypto theft

More from this day

See all →

More in: Security

See all →