Slopsquatting: Your AI Coding Agent Is Now a Supply Chain Attack Vector
The Mechanism Is Boring, Which Is Why It Works
An LLM suggests import requests-auth-helper; the package does not exist yet, but a week later someone publishes it on npm or PyPI after watching suggestion logs or enumerating plausible names. The next agent run installs it, the payload executes at install time, and the developer never typed the name.
The attacker does not need to guess what you will mistype. The model guesses for them.
Call it hallucination-squatting at scale: one model, used by millions of developers, emits the same plausible-but-nonexistent name often enough that squatting it is a reliable yield. North Korean APT groups noticed before security teams did.
Why Existing Controls Fail
The failure mode compounds with MCP STDIO vulnerabilities disclosed this week: 150M+ affected downloads across 30+ disclosures and 10+ CVEs from one root cause in the Model Context Protocol transport layer. The framing layer parses untrusted bytes before any model code runs, so a hostile tool response reaches a local shell before anyone reads a prompt.
The DAEMON Tools incident shows legitimate code signing certificates can be compromised. C2 ran over QUIC for 28 days undetected because most network monitoring treats QUIC as "UDP/443, probably Chrome," so the install looked signed and trusted while the payload executed anyway.
The Fix Is Three Controls, None Default
- Lockfile verification in CI: reject any package not already in your manifest without explicit human approval, and gate AI-generated dependency additions specifically.
- Registry allowlist at the network layer: for fully agentic workflows (Devin-style), sandbox execution with registry allowlisting so the agent cannot reach arbitrary packages.
- Install-time sandboxing: so a malicious
setup.pycannot read~/.aws/credentialson first run. Socket.dev flags newly-published packages, and lockfile-lint enforces pre-approved manifests.
Cross-Source Pattern
Five independent sources flagged overlapping aspects of this threat this week, and the convergence tells the story: agent autonomy scales faster than agent auditing. The vector varies across slopsquatted packages, MCP STDIO RCE, and certificate-compromised installers, but the pattern holds: install-time code execution moved inside the agent loop, while lockfile gates and network allowlists stayed where they were a year ago.
What to do
Add a pre-commit hook that fails on any new dependency not already in the lockfile — specifically targeting AI-generated additions
Disable auto-installation in AI coding agent configs (Copilot, Cursor, Claude Code) — set agents to read-only mode for dependency manifests
Deploy CI rule: reject any package whose name was added to lockfile in the last 7 days without a human-authored commit touching the manifest
Inventory all MCP-compatible tooling and assess STDIO transport usage; sandbox AI coding agents in containers with restricted network and filesystem access