Importing Phantoms: Measuring LLM Package Hallucination Vulnerabilities
Not on the map. Why?
Abstract (arXiv)
Large Language Models (LLMs) have become an essential tool in the programmer's toolkit, but their tendency to hallucinate code can be used by malicious actors to introduce vulnerabilities to broad swathes of the software supply chain. In this work, we analyze package hallucination behaviour in LLMs across popular programming languages examining both existing package references and fictional dependencies. By analyzing this package hallucination behaviour we find potential attacks and suggest defensive strategies to defend against these attacks. We discover that package hallucination rate is predicated not only on model choice, but also programming language, model size, and specificity of the coding task request. The Pareto optimality boundary between code generation performance and package hallucination is sparsely populated, suggesting that coding models are not being optimized for secure code. Additionally, we find an inverse correlation between package hallucination rate and the HumanEval coding benchmark, offering a heuristic for evaluating the propensity of a model to hallucinate packages. Our metrics, findings and analyses provide a base for future models, securing AI-assisted software development workflows against package supply chain attacks.
Key facts. Cited by 15 papers in the map (data through 7 Oct 2026). First posted on arXiv 31 Jan 2025.
Builds on
0 of 0 references.
No references here yet.
Built on by
Citing papers per year: 2025: 4; 2026: 11.
15 papers.
Sort:
By area:
- 2026HalluHard: A Hard Multi-Turn Hallucination Benchmarkcited by 7
- 2026Trust Me, Import This: Dependency Steering Attacks via Malicious Agent Skillscited by 4
- 2025Medicine on the Edge: Comparative Performance Analysis of On-Device LLMs for Clinical Reasoningcited by 3
- 2025Review of Hallucination Understanding in Large Language and Vision Modelscited by 2
- 2025Library Hallucinations in LLM-Generated Code: A Risk Analysis Grounded in Developer Queriescited by 1
- 2025HFuzzer: Testing Large Language Models for Package Hallucinations via Phrase-based Fuzzingcited by 1
- 2026Harmless Yet Harmful: Neutral Prompting Attacks for Stealthy Hallucination Steering in Agent Skillscited by 1
- 2026An Empirical Analysis of Static Analysis Methods for Detection and Mitigation of Code Library Hallucinationscited by 0
- 2026Training a General Purpose Automated Red Teaming Modelcited by 0
- 2026LLM Ghostbusters: Surgical Package Hallucination Suppression via Adaptive Unlearningcited by 0
- 2026The Range Shrinks, the Threat Remains: Re-evaluating LLM Package Hallucinations on the 2026 Frontier-Model Cohortcited by 0
- 2026Empirical Analysis and Detection of Hallucinations in LLM-Generated Bug Report Summariescited by 0
3 more
- 2026Cross Paraphrastic Invariance Learning for Hallucination Detectioncited by 0
- 2026Beware of Agentic Botnets: Scalable Untargeted Promptware Attacks via Universal and Transferable Adversarial HalluSquattingcited by 0
- 2026The Innocent Courier: Covert Exfiltration Through Legitimate LLM Web Fetchingcited by 0
- 2026The Innocent Courier: Covert Exfiltration Through Legitimate LLM Web Fetching1 Oct 2026
- 2026Beware of Agentic Botnets: Scalable Untargeted Promptware Attacks via Universal and Transferable Adversarial HalluSquatting8 Jul 2026
- 2026Cross Paraphrastic Invariance Learning for Hallucination Detection6 Jun 2026
- 2026Harmless Yet Harmful: Neutral Prompting Attacks for Stealthy Hallucination Steering in Agent Skills28 May 2026
- 2026Empirical Analysis and Detection of Hallucinations in LLM-Generated Bug Report Summaries22 May 2026
- 2026The Range Shrinks, the Threat Remains: Re-evaluating LLM Package Hallucinations on the 2026 Frontier-Model Cohort16 May 2026
- 2026Trust Me, Import This: Dependency Steering Attacks via Malicious Agent Skills10 May 2026
- 2026LLM Ghostbusters: Surgical Package Hallucination Suppression via Adaptive Unlearning1 May 2026
- 2026Training a General Purpose Automated Red Teaming Model24 Apr 2026
- 2026An Empirical Analysis of Static Analysis Methods for Detection and Mitigation of Code Library Hallucinations9 Apr 2026
- 2026HalluHard: A Hard Multi-Turn Hallucination Benchmark1 Feb 2026
- 2025HFuzzer: Testing Large Language Models for Package Hallucinations via Phrase-based Fuzzing28 Sep 2025
3 more
- 2025Review of Hallucination Understanding in Large Language and Vision Models26 Sep 2025
- 2025Library Hallucinations in LLM-Generated Code: A Risk Analysis Grounded in Developer Queries26 Sep 2025
- 2025Medicine on the Edge: Comparative Performance Analysis of On-Device LLMs for Clinical Reasoning13 Feb 2025
- 2026Trust Me, Import This: Dependency Steering Attacks via Malicious Agent Skillscited by 4
- 2026Harmless Yet Harmful: Neutral Prompting Attacks for Stealthy Hallucination Steering in Agent Skillscited by 1
- 2026Beware of Agentic Botnets: Scalable Untargeted Promptware Attacks via Universal and Transferable Adversarial HalluSquattingcited by 0
- 2026Beware of Agentic Botnets: Scalable Untargeted Promptware Attacks via Universal and Transferable Adversarial HalluSquatting8 Jul 2026
- 2026Harmless Yet Harmful: Neutral Prompting Attacks for Stealthy Hallucination Steering in Agent Skills28 May 2026
- 2026Trust Me, Import This: Dependency Steering Attacks via Malicious Agent Skills10 May 2026
- 2026HalluHard: A Hard Multi-Turn Hallucination Benchmarkcited by 7
- 2025Review of Hallucination Understanding in Large Language and Vision Modelscited by 2
- 2025Library Hallucinations in LLM-Generated Code: A Risk Analysis Grounded in Developer Queriescited by 1
- 2025HFuzzer: Testing Large Language Models for Package Hallucinations via Phrase-based Fuzzingcited by 1
- 2026An Empirical Analysis of Static Analysis Methods for Detection and Mitigation of Code Library Hallucinationscited by 0
- 2026The Range Shrinks, the Threat Remains: Re-evaluating LLM Package Hallucinations on the 2026 Frontier-Model Cohortcited by 0
- 2026Empirical Analysis and Detection of Hallucinations in LLM-Generated Bug Report Summariescited by 0
- 2026Cross Paraphrastic Invariance Learning for Hallucination Detectioncited by 0
- 2026Cross Paraphrastic Invariance Learning for Hallucination Detection6 Jun 2026
- 2026Empirical Analysis and Detection of Hallucinations in LLM-Generated Bug Report Summaries22 May 2026
- 2026The Range Shrinks, the Threat Remains: Re-evaluating LLM Package Hallucinations on the 2026 Frontier-Model Cohort16 May 2026
- 2026An Empirical Analysis of Static Analysis Methods for Detection and Mitigation of Code Library Hallucinations9 Apr 2026
- 2026HalluHard: A Hard Multi-Turn Hallucination Benchmark1 Feb 2026
- 2025HFuzzer: Testing Large Language Models for Package Hallucinations via Phrase-based Fuzzing28 Sep 2025
- 2025Review of Hallucination Understanding in Large Language and Vision Models26 Sep 2025
- 2025Library Hallucinations in LLM-Generated Code: A Risk Analysis Grounded in Developer Queries26 Sep 2025