Forget typosquatting; slopsquatting is the software supply chain threat created by AI coding tools
Core Mechanics of Slopsquatting
A new software supply chain vector, termed "slopsquatting," has emerged. In this attack model, threat actors register malicious packages on public registries—such as PyPI and npm—using names generated by Large Language Model (LLM) hallucinations. As developers increasingly rely on AI coding assistants (e.g., GitHub Copilot, ChatGPT) to generate boilerplate code, they frequently encounter hallucinated, non-existent library recommendations. Attackers exploit this pattern by proactively claiming these hallucinated package names and publishing malicious payloads.
Technical Significance
While typosquatting relies on human keyboard errors, slopsquatting exploits the deterministic failure modes of LLMs. Because LLMs operate on probabilistic token prediction, similar prompts often yield identical hallucinations across different user sessions.
Attackers can reverse-engineer or query popular LLMs to identify consistent hallucinations for specific programming tasks. Once identified, the corresponding malicious packages are uploaded to public registries. When a developer copy-pastes AI-generated code and runs dependency installation commands (e.g., pip install or npm install), the package manager resolves the dependency to the attacker's repository, leading to remote code execution (RCE) on developer workstations or CI/CD build servers.
Industry Implications
Slopsquatting shifts the security boundary for application security (AppSec) teams. Organizations can no longer rely solely on legacy software bill of materials (SBOM) scanning or static analysis of established dependencies.
To mitigate this threat, enterprise security architectures must implement:
- Zero-Trust Dependency Resolution: Restricting package managers to verified internal mirrors or curated registries.
- Pre-Execution Linting: Automated detection of unresolved external imports before packages are fetched from public registries.
- LLM Output Sanitization: AI assistance providers must integrate real-time package verification APIs to filter out hallucinated library references before presenting code to developers.