Skip to content

Typosquatting: One Letter from a Compromise

How lookalike packages land in real builds, the install-script trick that makes them instant, and the small habits that catch them at review.

Metal chain with one glowing red link

Short answer

Typosquatting publishes a malicious package under a name similar to a popular one. A single typo in package.json can run install scripts as CI. Copy names from official docs.

How it lands

Lookalike names, install scripts, and rushed PRs.

Review new dependencies like you review new users with admin rights - because install scripts often get that power.

Readers skimming typosquatting packages often stop at definitions. The part that prevents incidents is the verification step after the change - and the habit of re-checking after the next deploy that touches the same layer.

Habits that catch it

Copy package names from official docs, lockfiles required, alert on new dependencies, disable lifecycle scripts in CI when feasible.

Speed is not a virtue when the package name is wrong by one character.

Common failure mode for typosquatting packages: staging looks fine, production still serves the old config because a CDN, load balancer, or second vhost was never updated. Always verify the hostname customers hit.

After a bad install

Treat it as a compromise: rotate secrets the CI could reach, inspect what the script did, rebuild from known-good lockfiles.

Do not "just remove the line" and hope.

If this section on typosquatting packages becomes a recurring ticket, automate the check. Manual one-offs rot; a post-deploy assertion or weekly grade keeps the control honest.

What to do this week

  1. Audit recent new dependencies for lookalike names.
  2. Require lockfiles; ban floating versions on critical apps.
  3. Disable or review lifecycle scripts in CI.
  4. Document the "copy from official docs" rule for the team.

One letter. Full compromise. Slow down on new dependencies.

Run a free security grade on your domain · Pricing

Update log (1)

2026-06-29Editorial form rewrite for length and uniqueness.

Sources + verification

Practical guidance based on mainstream browser behavior, common reverse-proxy configuration, and widely published RFCs and vendor docs. Verify on your own stack with curl, browser devtools, and a re-scan after each change.

Keep reading

Breach npm audit Is Not Enough: Auditing Dependencies 2026-06-25 Breach One bad import: how supply-chain compromises start 2026-06-24 Breach Committed a Secret? Purge Git History Properly 2026-06-23