mlsanityData to 7 Oct 2026

Importing Phantoms: Measuring LLM Package Hallucination Vulnerabilities

arXiv 2501.19012 ↗First posted 31 Jan 2025cs.LG cs.CL cs.CRcited by 15

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

Cited by year (2026 to 7 Oct)

Citing papers per year: 2025: 4; 2026: 11.

15 papers.

Sort:

By area:

  1. 2026HalluHard: A Hard Multi-Turn Hallucination Benchmarkcited by 7
  2. 2026Trust Me, Import This: Dependency Steering Attacks via Malicious Agent Skillscited by 4
  3. 2025Medicine on the Edge: Comparative Performance Analysis of On-Device LLMs for Clinical Reasoningcited by 3
  4. 2025Review of Hallucination Understanding in Large Language and Vision Modelscited by 2
  5. 2025Library Hallucinations in LLM-Generated Code: A Risk Analysis Grounded in Developer Queriescited by 1
  6. 2025HFuzzer: Testing Large Language Models for Package Hallucinations via Phrase-based Fuzzingcited by 1
  7. 2026Harmless Yet Harmful: Neutral Prompting Attacks for Stealthy Hallucination Steering in Agent Skillscited by 1
  8. 2026An Empirical Analysis of Static Analysis Methods for Detection and Mitigation of Code Library Hallucinationscited by 0
  9. 2026Training a General Purpose Automated Red Teaming Modelcited by 0
  10. 2026LLM Ghostbusters: Surgical Package Hallucination Suppression via Adaptive Unlearningcited by 0
  11. 2026The Range Shrinks, the Threat Remains: Re-evaluating LLM Package Hallucinations on the 2026 Frontier-Model Cohortcited by 0
  12. 2026Empirical Analysis and Detection of Hallucinations in LLM-Generated Bug Report Summariescited by 0
3 more
  1. 2026Cross Paraphrastic Invariance Learning for Hallucination Detectioncited by 0
  2. 2026Beware of Agentic Botnets: Scalable Untargeted Promptware Attacks via Universal and Transferable Adversarial HalluSquattingcited by 0
  3. 2026The Innocent Courier: Covert Exfiltration Through Legitimate LLM Web Fetchingcited by 0