Join our Newsletter — 33% off our NHI Course
Threats, Abuse & Incident Response

Typosquatting

← Back to Glossary
By NHI Mgmt Group Updated November 23, 2026 Domain: Threats, Abuse & Incident Response

Typosquatting is the practice of naming a malicious package so it looks like a legitimate dependency with a small spelling change. In software supply chains, the goal is to get developers or automation to install attacker code before provenance or behaviour checks catch the deception.

What typosquatting means in software supply chains

Typosquatting exploits small naming mistakes, so the first problem is not code quality, but trust in the package name itself. A dependency that looks almost right can bypass casual review, autocomplete, or routine install flows long enough for attacker code to enter the build or runtime path.

This makes the term broader than a simple naming trick. It is a social and technical deception pattern that targets developer habits, package-manager behaviour, and automated dependency resolution. The danger is highest when organisations rely on loose versioning, broad install permissions, or unverified package sources.

How typosquatting succeeds

Typosquatting works because modern development workflows optimise for speed. A malicious package can borrow the visual shape of a legitimate one, then rely on hurried copy-paste, human error, or automation that trusts package names before deeper validation. In practice, that means the attacker is trying to win at the naming layer before any stronger integrity signal is checked.

The attack often overlaps with dependency confusion, brandjacking, or malicious package registration, but the core mechanism is still the same, misleading selection at the point of dependency resolution. Malicious Package and Dependency Confusion Guide covers the main variants and the controls that stop them from becoming build-time compromises.

Typosquatting is especially effective when package consumers assume registry results are trustworthy by default. If the organisation does not distinguish between a known internal dependency and a nearby public lookalike, the attacker only needs one successful install to gain execution, persistence, or data access.

Where organisations should look for exposure

Exposure usually starts with dependency inventory. Teams need to know which packages are approved, which registries are allowed, and which build systems can install from the public ecosystem. That visibility matters because the risk is not only “did we install the wrong package,” but also “could any automation have done so before controls noticed?”

Public package ecosystems are often the best place to search for lookalikes, especially where names resemble internal libraries, popular frameworks, or vendor tooling. A robust open-source review process helps here, and Open Source Security Guide is useful for mapping typosquatting to SCA, SBOM, pinning, and trusted publishing practices.

For internet-facing deception patterns, domain-style monitoring can also help because attackers often use adjacent naming strategies across package names and infrastructure. Typosquatting and Lookalike Domains Guide is relevant when the same naming logic appears in domains, certificates, and package ecosystems.

Controls that reduce typosquatting risk

The strongest defences make the “wrong” package harder to consume and easier to reject. Private registries, allowlisted sources, lockfiles, version pinning, and checksum or provenance verification all reduce the chance that a near-match gets installed just because it exists. For CI/CD specifically, OWASP CI/CD Top 10 CICD-SEC-3 Dependency Chain Abuse Guide is a good fit for teams that need concrete pipeline protections.

Controls should also assume that package names alone are not a trust signal. Where the ecosystem supports it, trusted publishing, provenance metadata, and namespace protections make it harder for attackers to register convincing substitutes. In higher-risk environments, denylisting known lookalikes and monitoring newly registered or suspiciously similar packages can shorten the window between publication and detection.

The best protection is layered, not singular. No single gate reliably stops every lookalike package, so organisations need both preventative controls at install time and review controls that catch what slips through.

Risk and Threat Considerations

Typosquatting matters because a successful package substitution can turn a routine dependency update into code execution, credential theft, or supply-chain compromise. The attacker is not trying to break cryptography, they are trying to exploit trust in naming, search, and install workflows.

Failure mechanism: A developer or automated build installs a malicious lookalike package before provenance checks, dependency review, or runtime monitoring can detect the substitution. That can introduce backdoors, secret theft, persistence, or downstream compromise inside build and deployment systems.

Impact: The result can include poisoned builds, stolen tokens or API keys, lateral movement through CI/CD, and contamination of downstream releases that inherit the tainted dependency.

Standards & Framework Alignment

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

SLSA, CIS Controls v8, OWASP ASVS and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
SLSASupply-chain Levels for Software ArtifactsTyposquatting targets artifact provenance and build integrity in the software supply chain
Recommendation — Require provenance checks for all dependencies and reject unverified build inputs.
CIS Controls v8CIS-5 — Account ManagementTyposquatting often abuses package and publishing identities to introduce malicious dependencies
Recommendation — Restrict approved package sources and review publisher identities before allowing installs.
OWASP ASVSV13 — ConfigurationDependency source control and install configuration determine whether lookalike packages can enter builds
Recommendation — Lock dependency sources and installation settings to approved, repeatable configurations.
NIST SP 800-53 Rev 5SA-12 — Supply Chain ProtectionTyposquatting is a supply-chain deception that must be addressed through protected acquisition and provenance
SI-7 — Software, Firmware, and Information IntegrityTyposquatted packages threaten software integrity by inserting malicious code through trusted update paths
Recommendation — Apply supply chain protection controls to verify dependency origin and integrity. Validate software integrity before installation and block untrusted dependency changes.

Practitioner Guidance

What to watch for: Treat any new dependency with a near-identical name, unusual maintainer history, or unexpected install script behaviour as a review event, not a routine update. Typosquatting is often easiest to stop at the moment a package enters the approved software inventory.

Practitioner takeaway: The practical defence is to shift trust away from name recognition and toward provenance, allowlisting, and controlled consumption paths.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on November 23, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org