A new cybersecurity risk called 'slopsquatting' is emerging as AI coding assistants like GitHub Copilot and ChatGPT become more widely adopted. The term describes a scenario where an AI model hallucinates a fake software package name—one that doesn't exist on official registries like npm or PyPI—and an attacker then publishes a malicious package under that name before a legitimate developer can claim it.
When a developer follows the AI's suggestion and installs the package, their system can be compromised, potentially leading to data theft, backdoor access, or supply chain attacks. The risk is amplified because AI tools generate code at scale, making it more likely that they'll produce nonexistent dependencies.
'Slopsquatting' exploits the trust developers place in AI-generated code and the lag between the AI's suggestion and the real package being published. Security researchers warn that as AI code generation grows, so will this attack vector, urging developers to verify every package name manually and for registry maintainers to implement safeguards like reserving commonly hallucinated names.
While not yet widespread, the technique has been demonstrated in proof-of-concept attacks and is expected to rise alongside AI-assisted development.