Safeguard
Supply Chain•

Typosquatting, dependency confusion, slopsquatting: what differs?

Plain language comparison of typosquatting, dependency confusion, namespace squatting and slopsquatting: who is tricked and which defense fits.

Safeguard Security Team
3 min read

In typosquatting, a person mistypes a name. In dependency confusion, a build tool picks the wrong source for a name. In namespace squatting, an attacker claims a scope or prefix. In slopsquatting, an AI assistant invents a name that an attacker then registers. Each tricks a different party, so each needs a different defense.

The comparison

AttackWho is trickedWhat the attacker registersMain defense
TyposquattingA developer typing or copying a nameA near miss of a popular nameCheck names, review additions
Dependency confusionThe package managerA public package named like a private oneOne controlled source, scope mapping
Namespace squattingDevelopers and tools trusting a prefixA scope or prefix implying an ownerClaim your namespaces
SlopsquattingA developer trusting AI outputA name an AI model made upVerify every suggested package exists

Typosquatting

Think of a name one letter off from a well known library. The attacker waits for installs. PyPI's report page lists typo-squatting among valid reasons to report a project as malware. Read more in our typosquatting anatomy post.

Dependency confusion

Here the name is exact but the source is wrong. pip's documentation warns that using an extra index for private packages is unsafe because of dependency confusion, and NuGet's source mapping page describes the non determinism that arises when a package exists on several sources. See dependency confusion explained.

Namespace squatting

The attacker takes a scope, prefix or group name that suggests a trusted owner. Registries answer with scope ownership, reserved prefixes and verified group IDs. See what is namespace squatting.

Slopsquatting

AI models can suggest packages that do not exist. If an attacker registers that name, anyone who trusts the suggestion installs it. See how slopsquatting works.

One checklist that covers all four

  1. Confirm every new package exists, is the one you meant, and is maintained.
  2. Send private names to private sources only.
  3. Claim your own scopes and prefixes.
  4. Keep an inventory so you can find a bad package fast.
  5. Add a review step for dependency changes in pull requests.

Click through it at your own pace, or open it full screen. Look at what a gate can check before a dependency change merges.

Quick check

Which attack is hardest to stop with a version pin?

Typosquatting and slopsquatting, because the wrong package is added on purpose by a person. A pin keeps the wrong package at its pinned version.

Can one control stop dependency confusion everywhere?

No. Each ecosystem has its own mechanism: scope mapping in npm, source mapping in NuGet, a single index for pip, a mirror for Maven.

Safeguard policies and gates can review dependency changes in pull requests, and a free scan shows your current tree.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.