How the attack works
An attacker crafts a shell command that starts with something innocuous, such as 'git status' or 'npm test', so the request looks routine to whoever or whatever is approving it. Chained onto that command, using operators like '&&' or ';', is a second command that reads environment variables, .env files, or API keys and sends them out using curl -X POST, wget -qO-, or netcat. The whole thing runs as one shell instruction, so an AI agent that executes shell commands on a user's behalf may run it without inspecting each piped or chained segment. The result is the attacker's server receiving secrets that were never meant to leave the machine.
Why it matters
Successful exfiltration exposes API keys, credentials, and other environment secrets to an outside party, which can lead to further account takeover or unauthorized access to connected systems.
What you can do
- Require agents to parse and evaluate each command in a chain separately rather than approving the whole pipeline at once.
- Restrict or flag outbound network commands (curl, wget, nc) issued by agents, especially when combined with reads of environment variables or .env files.
- Maintain an allowlist of approved webhook destinations for CI/CD and monitoring agents, and block posts to unlisted endpoints.
- Log and review full shell command strings executed by agents, not just the first command in a chain, before or after execution.
Known benign look-alikes
- CI/CD agents posting legitimate build status to authorized webhooks
- Monitoring agents sending metrics to approved telemetry endpoints