Join our Newsletter — 33% off our NHI Course

Typosquat Dependency

A typosquat dependency is a software package or module name that closely imitates a legitimate dependency, causing developers or build systems to install the wrong artifact. In supply chain security, it creates a path for malicious code delivery, credential theft, or persistence when package resolution trusts names more than verified provenance.

What Typosquat Dependencies Are

A typosquat dependency is a package or module name that looks almost identical to a legitimate dependency, so installers, dependency bot, or developers can resolve the wrong artifact and bring untrusted code into the build.

Why Typosquat Dependencies Are Dangerous

The danger is not just a mistaken install. A convincing fake package can sit in the normal dependency path, making malicious code look like routine software maintenance while it quietly inherits the trust users place in package registries and dependency names.

That trust gap matters because modern build systems often automate resolution, updates, and transitive pulls. If the dependency name is the main signal and provenance checks are weak, a typo can become a delivery channel for credential theft, backdoors, or persistence.

How Typosquat Dependencies Enter the Supply Chain

Typosquatting usually works by registering a package name that differs by one character, punctuation mark, or word order from a popular dependency. The attacker relies on human error, copy-paste mistakes, autocomplete, dependency confusion, or overly broad package matching to get the wrong artifact installed.

This risk can appear in direct dependencies, transitive dependencies, internal mirrors, CI pipelines, and developer workstations. Once the wrong package is trusted upstream, every downstream environment that consumes the build can inherit the compromise.

How Teams Reduce Exposure and Recover

The strongest defenses are inventory, provenance, and policy. Teams should know exactly which packages they depend on, where those packages come from, and which registries or mirrors are allowed to satisfy a request. OpenSSF is useful here because its open source supply chain work focuses on practical controls for package integrity and trusted software delivery.

Package pinning, allowlists, lockfiles, checksum verification, signed artifacts, and controlled registry configuration all reduce the chance that a lookalike package can be accepted silently. When a suspicious dependency is discovered, the response should include removing the artifact from builds, checking which systems pulled it, and reviewing logs for any post-install activity tied to the package.

After removal, teams should assume the compromise may have touched secrets, tokens, or CI credentials exposed during installation or test execution. Rebuilding from trusted sources and reviewing dependency history are often necessary before declaring the environment clean.

What To Watch For in Builds and Developer Environments

Warning signs include an unexpected new package name, a dependency that appears only after an update, unusual install-time network calls, or build failures that appear after package substitution. Typosquats also become easier to spot when teams compare package metadata, ownership history, and publishing patterns instead of trusting name similarity alone.

For broader software supply chain hygiene, it helps to align dependency review with established supply chain controls and artifact integrity practices such as SLSA, which emphasizes provenance and protected build paths. That same mindset also fits dependency governance guidance from OWASP SAMM, where dependency control belongs inside the software assurance process, not as an afterthought.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

SLSA, OWASP SAMM and CIS Controls v8 set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
SLSA Supply Chain Levels for Software Artifacts Typosquat dependencies are a software supply chain integrity problem.
Recommendation — Require provenance and integrity checks before allowing dependency artifacts into builds.
OWASP SAMM Software Assurance Maturity Model Dependency governance fits secure software delivery and supply chain maturity.
Recommendation — Embed dependency review and trusted-source controls into the SDLC.
CIS Controls v8 CIS-16 — Application Software Security Secure software acquisition and dependency handling are part of application security hygiene.
Recommendation — Verify third-party components and restrict approved software sources.