Skip to content
Vol. 1 · Ed. 2026
CyberGlossary
Entry № 1183

Typosquatted Package

What is Typosquatted Package?

Typosquatted PackageA malicious open-source package published under a name that closely resembles a popular library so that developers install it by mistake.


Typosquatted packages target the ecosystem-level autocomplete habits of developers. The attacker picks a widely used library — react, lodash, requests, cross-env, urllib3 — and publishes a malicious package with a tiny variation in the name (crossenv vs cross-env, python3-dateutil vs python-dateutil) on npm, PyPI, RubyGems, or NuGet. When a developer mistypes, copies bad documentation, or relies on AI suggestions, the malicious package is installed and its post-install or import code runs payloads that steal tokens, plant backdoors, or drain crypto wallets. Defences include lockfiles, package allow-lists, dependency-review tools (Socket, Snyk, GitHub Dependency Review), strict CI policies for new dependencies, and registry-side namespace protections.

Examples

  1. 01

    crossenv on npm (vs the legitimate cross-env) shipped credential-stealing code in 2017.

  2. 02

    python3-dateutil and jeIlyfish on PyPI in 2019 typosquatted popular libraries to steal SSH keys.

Frequently asked questions

What is Typosquatted Package?

A malicious open-source package published under a name that closely resembles a popular library so that developers install it by mistake. It belongs to the Attacks & Threats category of cybersecurity.

What does Typosquatted Package mean?

A malicious open-source package published under a name that closely resembles a popular library so that developers install it by mistake.

How does Typosquatted Package work?

Typosquatted packages target the ecosystem-level autocomplete habits of developers. The attacker picks a widely used library — react, lodash, requests, cross-env, urllib3 — and publishes a malicious package with a tiny variation in the name (crossenv vs cross-env, python3-dateutil vs python-dateutil) on npm, PyPI, RubyGems, or NuGet. When a developer mistypes, copies bad documentation, or relies on AI suggestions, the malicious package is installed and its post-install or import code runs payloads that steal tokens, plant backdoors, or drain crypto wallets. Defences include lockfiles, package allow-lists, dependency-review tools (Socket, Snyk, GitHub Dependency Review), strict CI policies for new dependencies, and registry-side namespace protections.

How do you defend against Typosquatted Package?

Defences for Typosquatted Package typically combine technical controls and operational practices, as detailed in the full definition above.

What are other names for Typosquatted Package?

Common alternative names include: Package typosquatting, Name-confusion attack.

Related terms