LIVE FEED
ATLAS OWASP HIGH Significant risk · Prioritise patching RELEVANCE ▲ 8.5

AI Coding Agents Exploited via Hallucinated Package Names

TL;DR HIGH
  • What happened: AI coding agents hallucinate predictable package names attackers pre-register to deliver malicious code autonomously.
  • Who's at risk: Developers and organisations using AI coding agents (Cursor, Copilot, Gemini CLI, Windsurf, Cline) with automated fetch or install permissions are directly exposed.
  • Act now: Audit and restrict AI agent permissions to fetch or install external packages without human approval · Implement allowlists for approved package registries and repositories used by AI coding agents · Monitor agent-initiated network requests and flag any resolution of previously unseen package or domain names
AI Coding Agents Exploited via Hallucinated Package Names

Overview

A unified attack class exploiting AI coding agent hallucinations has been formally documented by researchers at Tel Aviv University, Technion, and Intuit in a paper published 8 July 2026. Branded under three names—slopsquatting (fake package names), phantom squatting (fake domains), and HalluSquatting (fake repositories or skills)—the underlying mechanism is identical: a language model generates a plausible-sounding but nonexistent identifier, the agent trusts it without verification, and an attacker who has pre-registered that identifier intercepts the fetch. No credentials are stolen, no phishing lure is required, and no human click is needed. The agent does the delivery work autonomously.

Technical Analysis

The research team, led by Aya Spira in Ben Nassi’s group, tested multiple prompts against Cursor, Windsurf, GitHub Copilot, Cline, Gemini CLI, and OpenClaw. Key findings:

  • Models hallucinated identical package/repository names up to 85% of the time for repository requests across repeated prompt runs.
  • For skill installs, hallucination consistency reached 100%, meaning attackers can predict the exact name that will be requested before the developer ever issues a prompt.
  • The determinism of hallucinations is the critical enabler: an attacker does not need to intercept traffic or compromise a registry—they simply calculate the likely hallucinated name, register it, and wait.

The attack flow is straightforward:

  1. Attacker profiles an LLM’s hallucination patterns for a given task category.
  2. Attacker registers the predicted package name, domain, or skill identifier on the relevant platform.
  3. Developer asks an AI coding agent to scaffold, extend, or automate a task.
  4. Agent outputs the hallucinated name and, if granted fetch/install permissions, retrieves and executes the attacker-controlled payload.

Unlike traditional dependency confusion, the attacker does not need an existing legitimate package to shadow—the name never existed in the first place.

Framework Mapping

FrameworkIDRationale
MITRE ATLASAML.T0010Malicious package injected into the ML-assisted development supply chain
MITRE ATLASAML.T0047Attack surface is the ML-enabled coding product itself
MITRE ATLASAML.T0051Agent output is manipulated through crafted prompts to produce predictable hallucinations
OWASP LLMLLM08Agent acts on unverified output with excessive autonomy
OWASP LLMLLM09Developer/pipeline overreliance on agent-generated identifiers without validation
OWASP LLMLLM05Third-party package ecosystem compromised via hallucinated identifiers

Impact Assessment

Any developer or CI/CD pipeline delegating fetch, install, or skill-acquisition tasks to an AI coding agent is exposed. The scale implication is significant: because agents handle delivery autonomously, a single attacker registration can propagate malicious code across every team using the same agent and prompt pattern. The researchers frame their measured hallucination rates as a floor, noting that attack techniques improve over time. Organisations running exposed agents in production pipelines face potential botnet-scale compromise without the traditional indicators of a supply chain attack.

Mitigation & Recommendations

  • Enforce human-in-the-loop approval for any agent action that fetches, installs, or executes external code or resources.
  • Implement package/domain allowlists and reject any agent-requested identifier not on a pre-approved list.
  • Validate all agent-generated identifiers against live registry lookups before acting on them; treat a non-existent package as a red flag, not a fallback.
  • Log and alert on novel external resolutions initiated by AI agents in development and CI/CD environments.
  • Prefer pinned, hash-verified dependencies rather than agent-resolved names to eliminate the hallucination vector entirely.
  • Assess which coding agent tools in your environment have autonomous fetch capabilities and reduce their permission scope immediately.

References

◉ AI THREAT BRIEFING

Stay ahead of the threat.

Twice-weekly digest of critical AI security developments — every story mapped to MITRE ATLAS and OWASP LLM Top 10. Free.

No spam. Unsubscribe anytime.