Cybersecurity researchers at Kaspersky have identified a new supply chain vulnerability emerging from the widespread adoption of AI-generated code.
As AI assistants increasingly participate in software development-with Microsoft CTO Kevin Scott predicting AI will write 95% of code within five years-a phenomenon called “slopsquatting” poses significant security threats.
This risk stems from AI systems hallucinating non-existent software dependencies that attackers could exploit by creating malicious packages with these phantom names.
A comprehensive study examining 576,000 Python and JavaScript code samples generated by 16 popular large language models (LLMs) revealed concerning patterns of hallucinated dependencies.
While GPT-4 and GPT-4 Turbo demonstrated the lowest rates of fictitious libraries (under 5%), other models showed significantly higher rates-DeepSeek models exceeded 15%, and CodeLlama 7B topped 25%.
Even adjusting randomness parameters like temperature and top-p values failed to reduce hallucinations to negligible levels.
The research uncovered that JavaScript code contained more phantom dependencies (21%) compared to Python (16%), with newer technologies triggering 10% more non-existent packages.
Most alarming was the discovery that 43% of hallucinated package names consistently reappeared across multiple generation attempts.
The naming patterns followed recognizable patterns: 13% resembled typos differing by a single character from legitimate packages, 9% borrowed names from other programming languages, and 38% used logically plausible but non-existent names.
This new attack vector, named “slopsquatting,” exploits the predictable nature of AI hallucinations.
Unlike traditional typosquatting that targets human typing errors, slopsquatting capitalizes on repeated AI mistakes.
Attackers can run popular AI models, identify frequently hallucinated package names, and publish malicious libraries using these names in public repositories.
The risk intensifies with “vibe coding” practices-where developers provide high-level instructions to AI with minimal code review.
Should developers or automated systems attempt to install all referenced packages without verification, malicious dependencies could compromise the entire supply chain (ATT&CK T1195.001).
With nearly 20,000 malicious libraries discovered in open-source repositories over the past year, security experts anticipate threat actors will systematically exploit this vulnerability.
Kaspersky recommends five essential measures to mitigate slopsquatting risks:
These precautions become increasingly critical as organizations integrate AI assistants into software development workflows, potentially exposing themselves to this emerging threat vector.
Setting Up SOC Team? – Download Free Ultimate SIEM Pricing Guide (PDF) For Your SOC Team -> Free Download
Attackers abused compromised ConnectWise Cloud Backup credentials to access Microsoft 365 customer environments, prompting ConnectWise…
Anthropic says an internal Claude research model reconstructed how the National Security Agency generated seeds…
Two WordPress Core vulnerabilities can be chained to execute remote code without authentication, according to…
A newly disclosed OpenBSD kernel exploitation chain combines a shared memory accounting flaw with a…
GhostAction attackers have expanded their GitHub credential theft campaign with a second stage that disguises…
Indian authorities have warned that SideCopy hackers are targeting Indian organizations, including academic institutions, with…