Join our Newsletter — 33% off our NHI Course

How did package-name lookalikes in npm and PyPI become a risk?

 

(@nhi-mgmt-group)
Member Moderator
Joined: 2 years ago
Posts: 20225
Topic starter  

TL;DR: Package-name lookalikes in npm and PyPI can turn an install into code execution, stolen credentials, and downstream tampering, ThreatLocker reports. Build runners need tighter approval, version pinning, and runtime limits so a bad package cannot run with broad access.

Editorial analysis by NHI Mgmt Group, based on content published by ThreatLocker: “How to mitigate typosquatting and slopsquatting attacks in npm and PyPI”.

Key questions

Q: Why do typosquatting and slopsquatting create code execution risk instead of just bad dependencies?

A: Because many package managers allow install-time scripts and other lifecycle hooks to run as part of setup.

Q: Where do package supply chain controls fail in practice?

A: They fail when teams rely on review alone and leave build runners over-privileged.

Q: How should security teams prevent malicious packages from running in build environments?

A: Start by treating package installation as an execution event, not a file download.

Practitioner guidance

  • Verify dependency names before approval Check the exact package name against official documentation, repository metadata, publisher history, and expected release patterns before any install is allowed.
  • Lock down package installation paths Use approved dependency lists, lockfiles, internal registries or proxies, and review every new package or version change before it reaches a build.
  • Disable unnecessary install scripts Block lifecycle hooks such as npm install scripts in build contexts where they are not required, because those scripts are the execution point for many malicious packages.

Bottom line: Typosquatting and slopsquatting succeed because package selection often inherits trust without enough verification, which makes the install step a security decision.

Glossary terms: Typosquatting, Slopsquatting, Install hook, Dependency Allowlist

Explore further

View Full Forum →  |  NHI Foundation Course →  |  Our Services →  |  Read the full analysis →


This topic was modified 1 week ago by NHI Mgmt Group

   
Quote
(@mr-nhi)
Member Moderator
Joined: 6 months ago
Posts: 20715
 

Typosquatting is now a build-time identity problem, not just a supply chain nuisance. The article shows that package choice can impersonate trust in the same way a forged account or token does, because the install step inherits whatever privilege the build runner already has. That makes publisher verification, package provenance, and runtime containment part of identity governance for software delivery. Practitioners should treat the package name as an access request, not a trusted instruction.

A question worth separating out:

Q: What is the difference between dependency verification and application allowlisting?

A: Dependency verification tries to ensure the right package is chosen before installation. Application allowlisting controls what can execute after that choice is made. Both matter, but they solve different problems: one reduces selection errors, the other limits damage when a malicious package or script gets through.

👉 Read our full editorial: Typosquatting and slopsquatting turn package names into trust risks


This post was modified 1 week ago by NHI Mgmt Group

   
ReplyQuote
Share:

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.