Skip to content
Submit incident
AII-1001-88499
Well documentedThree or more independent publishers report the core facts.

UTSA Study: AI-Generated Code Package Hallucinations Pose Security Risks

UTSA researchers conducted a comprehensive study on risks posed by AI-generated code, focusing on "package hallucinations" where large language models recommend non-existent third-party software libraries. The study found that developers relying on AI coding assistance could unknowingly run malicious code uploaded to open-source repositories by bad actors exploiting this vulnerability.

8 April 2025 Β· Security and cyberattacks
8 April 2025
AII-1001-884995 sources ↓
Quick facts
Category
Security and cyberattacks
Country
United States
Source
Science
Date
8 April 2025
Drafted by
Raidu Incident Detection

What happened

UTSA researchers led by doctoral student Joe Spracklen conducted a comprehensive study on risks of using large language models (LLMs) to develop software, with results accepted for publication at the USENIX Security Symposium 2025.

The study focused on 'package hallucinations,' where LLMs generate or recommend the use of third-party software libraries that do not actually exist. According to the researchers, up to 97% of software developers incorporate generative AI into their workflow, and 30% of code written today is AI-generated.

Reported impact

Package hallucinations create security vulnerabilities: when an LLM recommends a non-existent package, developers who trust and run the code could unknowingly install malicious code uploaded to open-source repositories by bad actors exploiting this behavior.

The vulnerability is described as simple and ubiquitous, requiring only a single everyday command that programmers typically use daily to trigger the issue.

Index analysis

Package hallucinations represent a novel attack vector, as bad actors can upload malicious code disguised as legitimate packages to centralized repositories used by popular programming languages such as PyPI for Python and npm for JavaScript.

The research highlights that LLMs frequently generate insecure code, and the phenomenon occurs through basic operations that developers perform routinely without specialized knowledge or complex circumstances.

Classification

Category
Security and cyberattacks
Industry
Digital security
Country
United States
Harm status
Potential harm
Intent
Intentional
Timing
Unknown
Harm types
Public interest
Failure modes
Hallucination, Unsafe recommendation
AI systems
Large Language Models (LLMs), ChatGPT

Sources and evidence

This record was researched and written by the Index, based on the following original reporting.

Science
New Study from The University of Texas at San Antonio Uncovers AI Threats
8 April 2025
eeNews Europe
LLMs used to code can introduce serious errors
8 April 2025
EurekAlert!
AI threats in software development revealed in new study from The University of Texas at San Antonio
8 April 2025
innovations-report.com
AI Threats in Software Development: New Study Insights - Innovations Report
8 April 2025
Mirage News
UTSA Study Unveils AI Risks in Software Development
8 April 2025