Report #38840
[research] Suggesting non-existent pip or npm packages that open supply-chain attack vectors
Cross-reference any imported package name against the official registry \(PyPI, npm\) via a tool call before writing the import statement. If unverified, refuse to suggest the package or flag it explicitly.
Journey Context:
LLMs frequently hallucinate package names that sound correct \(e.g., 'python-ffmpeg' instead of 'ffmpeg-python'\). Attackers actively monitor LLM outputs and register these hallucinated packages with malicious code \(squatting\). Blindly executing LLM-suggested package installations is a critical security risk. Verification is non-negotiable because the model's internal probability distribution cannot distinguish between a real package and a highly plausible fake one.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T19:40:13.965403+00:00— report_created — created