4 Sources
[1]
AI-generated code could be a disaster for the software supply chain. Here's why.
AI-generated computer code is rife with references to non-existent third-party libraries, creating a golden opportunity for supply-chain attacks that poison legitimate programs with malicious packages that can steal data, plant backdoors, and carry out other nefarious actions, newly published
[2]
AI Code Hallucinations Increase the Risk of 'Package Confusion' Attacks
A new study found that code generated by AI is more likely to contain made-up information that can be used to trick software into interacting with malicious code. AI-generated computer code is rife with references to non-existent third-party libraries, creating a golden opportunity for
[3]
Slopsquatting: The worrying AI hallucination bug that could be spreading malware
Software sabotage is rapidly becoming a potent new weapon in the cybercriminal arsenal, augmented by the rising popularity of AI coding. Instead of inserting malware into conventional code, criminals are now using AI-hallucinated software packages and library names to fool unwary programmers. It
[4]
AI Hallucinations & Slopsquatting: A Caution for Blockchain Devs
AI Hallucinations and Slopsquatting: The Hidden Risk in Autocomplete Coding One of the first topics that entered the mainstream artificial intelligence (AI) debate was AI hallucinations. These plausible outputs follow content standards but are factually or logically incorrect. Despite sounding
Share
Copy Link
Recent research reveals that AI-generated code frequently contains references to non-existent packages, potentially opening doors for malicious actors to exploit these "hallucinations" in supply chain attacks.

Recent research has uncovered a significant security risk in AI-generated code, potentially compromising the software supply chain. A study involving 16 widely used large language models (LLMs) revealed that AI-generated code frequently contains references to non-existent third-party libraries, a phenomenon dubbed "package hallucination"
1
.The study, which analyzed 576,000 code samples, found that 440,000 package dependencies were hallucinated, with 205,474 unique package names
2
. Open-source models were particularly prone to this issue, with 21% of dependencies linking to non-existent libraries1
.These hallucinated dependencies exacerbate the risk of "dependency confusion" or "package confusion" attacks. In such attacks, malicious actors can exploit these non-existent package references by publishing malware under the hallucinated names
3
.Alarmingly, 43% of package hallucinations were repeated over 10 queries, and 58% of hallucinated packages appeared more than once in 10 iterations
2
. This persistence makes the vulnerability more exploitable for malicious actors.The study revealed disparities in hallucination rates:
1
.1
.3
.Related Stories
This vulnerability has given rise to a new attack vector called "slopsquatting," where attackers create malware packages with names matching the AI-hallucinated ones
4
. This technique builds upon the existing threat of typosquatting, where attackers exploit common misspellings.The blockchain and cryptocurrency sectors are particularly vulnerable to these threats. Recent incidents have involved fake packages mimicking legitimate libraries like bitcoinlib, targeting crypto wallets through malicious Python libraries
4
.To combat these risks, experts recommend:
4
As AI continues to play a larger role in software development, addressing these security concerns becomes crucial to maintaining the integrity of the software supply chain.
Summarized by
Navi
13 Apr 2025•Technology

08 Jul 2026•Technology

29 Jul 2025•Technology

1
Science and Research

2
Policy and Regulation

3
Technology