
AI Code Hallucinations Increase the Risk of ‘Package Confusion’ Attacks
Dan Goodin, Ars Technica
created: April 30, 2025, 7:08 p.m. | updated: May 3, 2025, 10:01 a.m.
The study, which used 16 of the most widely used large language models to generate 576,000 code samples, found that 440,000 of the package dependencies they contained were “hallucinated,” meaning they were nonexistent.
Package Hallucination FlashbacksThese nonexistent dependencies represent a threat to the software supply chain by exacerbating so-called dependency confusion attacks.
These attacks work by causing a software package to access the wrong component dependency, for instance by publishing a malicious package and giving it the same name as the legitimate one but with a later version stamp.
Among these 440,445 package hallucinations, 205,474 had unique package names.
One of the things that makes package hallucinations potentially useful in supply-chain attacks is that 43 percent of package hallucinations were repeated over 10 queries.
1 month, 1 week ago: WIRED