Course contentsShow
← Security
Lesson 1287 of 3,05226. Application Security - Supply ChainFree lesson

Typosquatting Attack Techniques

How attackers register package names similar to popular packages to exploit typos and mislead developers.

Typosquatting Attack Techniques

What you'll learn: How attackers exploit common typing mistakes to trick developers into installing malicious packages with names almost identical to legitimate libraries.


The Core Concept

Typosquatting (also called "combosquatting") is when attackers register package names that are almost the same as popular, trusted packages—relying on developers making simple typos during installation. When you accidentally type reqeusts instead of requests, you might download a malicious package designed to steal credentials, inject backdoors, or compromise your supply chain.

Think of it like fake storefronts in a busy shopping district: legitimate stores like "Nike" attract crowds, so scammers open "Nikee" or "Niке" (with a Cyrillic 'е') next door, hoping rushed shoppers don't notice the difference.

Common Typosquatting Patterns

Attackers use predictable strategies:

  • Character omission: requsts instead of requests
  • Character repetition: requestss or reqquests
  • Character transposition: reqeusts (swapped letters)
  • Character substitution: rekvests (visually similar)
  • Hyphenation: node-sqlite vs nodesqlite
  • Homoglyphs: Using lookalike characters from different alphabets (Cyrillic 'а' vs Latin 'a')

These malicious packages often contain code that executes during installation (via setup scripts or post-install hooks), meaning the damage happens before you even realize the mistake.

Why This Works

Developers work fast, copy-paste commands from memory, and rarely double-check exact spelling. Package managers automatically resolve names without confirming intent, making a single typo potentially catastrophic—especially in automated CI/CD pipelines where humans don't review every installation.

Key Takeaway: Typosquatting exploits human error and automated trust: attackers register misspelled versions of popular package names to distribute malware, stealing data or compromising systems when developers accidentally install the wrong package.