npm Typosquat Checker

Scan any npm package name for lookalike packages that could be used in a typosquatting or dependency confusion supply-chain attack. Each result is risk-scored across six signals — recency, download volume, description similarity, attack vector, maintainer count, and lifecycle script presence.

Access the full tool

Free for all SpoofChecker members. Log in to run a scan.

Log in to scan →

What this tool detects

🔍
Typosquat variants

Character swaps, omissions, insertions, transpositions, and homoglyph substitutions across hundreds of generated variants.

📦
Dependency confusion

Scope-strip attacks — public packages that shadow your private @org/package and get resolved by npm automatically.

Lifecycle script malware

postinstall / preinstall scripts that execute arbitrary code the moment a developer runs npm install.

📊
Risk scoring

HIGH / MED / LOW classification based on registration date, download volume, description copy, and attack vector type.

📅
Recency signals

Packages registered in the last 30 days are the highest-risk — active squatting campaigns typically register fresh.

💾
CSV & JSON export

Download the full report for ticketing, audit trails, or piping into your own security tooling.

Frequently asked questions

What is npm typosquatting?
npm typosquatting is when an attacker registers a package name that closely resembles a popular legitimate package — for example lodahs instead of lodash. Developers who mistype the name during installation unknowingly install the attacker's code, which often contains a postinstall script that exfiltrates environment variables, tokens, or credentials.
What is a dependency confusion attack?
A dependency confusion (or namespace confusion) attack targets internal packages that exist only under a private scope — e.g. @mycompany/utils. If an attacker publishes a public package with the unscoped name utils, npm may resolve to the public version instead, silently installing the attacker's code with no typo required.
What attack patterns does this checker cover?
The fuzzer generates variants using: character omission, transposition, substitution (including homoglyphs), insertion, repetition, separator swap (hyphens ↔ underscores), word order swap, prefix/suffix addition, bit-squatting, and scope-strip (dependency confusion). Each variant is checked against the live npm registry.
How is the risk score calculated?
Six signals contribute to a numeric score: (1) package registration recency — under 30 days scores +3; (2) zero weekly downloads — +2; (3) description similarity to the target via Jaccard word-set comparison — copied descriptions score +3; (4) high-impact attack vector — +1; (5) single maintainer — +0.5; (6) no published version — +1. Score ≥ 4 = HIGH (red), ≥ 2 = MED (amber), < 2 = LOW (green).
What are postinstall script attacks?
npm's postinstall, preinstall, install, and prepare lifecycle scripts run automatically during npm install with no user interaction. Malicious packages use these to exfiltrate secrets, install backdoors, or mine cryptocurrency. This tool checks the package.json of high-risk variants and flags any that define these scripts.