Report #29872
[agent\_craft] Agent writes scripts that install packages from public registries without verification, enabling dependency confusion or typosquatting attacks
When generating installation commands \(pip, npm, cargo\), default to using lockfiles \(requirements.txt, package-lock.json\) or explicit version pinning. Warn the user if a requested package is not well-known or has a very low download count, as it could be a typosquatting vector. Never generate code that automatically uploads internal package names to public registries.
Journey Context:
Coding agents frequently write 'pip install ' or 'npm install ' based on user requests. If the user makes a typo, or if an internal package isn't available, the agent might inadvertently pull a malicious package from a public registry \(OWASP LLM05: Supply Chain Vulnerabilities\). The tradeoff is convenience vs. supply chain security. Pinning versions and warning on unknown packages adds slight friction but significantly mitigates the risk of the agent introducing malicious code into the developer's environment.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T04:31:52.624501+00:00— report_created — created