Join our Newsletter — 33% off our NHI Course

What do teams get wrong about defending against dependency confusion, typosquatting, and repository jacking?

Teams often focus on static vulnerability findings while underweighting provenance, contributor trust, and package behavior. That leaves gaps when an attacker uses a legitimate-looking package name, hijacked repository, or poisoned dependency to bypass normal review. Effective defense requires treating source credibility and package lineage as security signals, not just code quality indicators.

Why these attacks succeed even when code review looks “clean”

dependency confusion, typosquatting, and repository jacking succeed because defenders often validate the package itself, but not the trust chain around it. The package name may look familiar, the repository may appear established, and the code may not trigger a conventional vulnerability scan, yet the attacker still controls distribution, update timing, or maintainer trust.

That makes provenance a first-class security property. The relevant questions are who published the artifact, how the maintainer relationship was established, whether the source is still under legitimate control, and whether package resolution rules can be abused to prefer a malicious source over the intended one.

For open source supply chains, that means the defense surface is broader than malicious code detection. It includes namespace governance, repository ownership, registration hygiene, signing or provenance verification, and the rules your tooling uses to choose one dependency source over another. Resources like OpenSSF and SLSA are useful because they focus attention on build integrity and provenance, not just artifact content.

What defenders usually miss in practice

The most common mistake is treating all three issues as variants of “bad package code.” They are related, but the failure modes differ. Dependency confusion abuses resolver priority and namespace assumptions. Typosquatting exploits human and tooling error around package naming. Repository jacking exploits stale ownership, abandoned projects, or trust in a source that no longer reflects legitimate control.

Another blind spot is assuming package popularity or age implies safety. A name can be legitimate-looking and still be attacker-controlled if the registry, repository, or maintainer path is compromised. Likewise, a package can be “known” internally but still be pulled from the wrong source if build systems are not pinned, allowlisted, or otherwise constrained.

Static scanners are still useful, but they do not answer the core trust question. A clean scan does not prove the package was intended, maintained, or published by the right party. Teams need controls that validate source selection, maintainership, and artifact lineage before the code ever reaches the scanner.

Risk and Threat Considerations

These attacks are attractive because they let an adversary insert code into trusted build and deployment paths without needing to exploit a technical vulnerability in the application itself. Once a poisoned dependency is accepted, the blast radius can include build compromise, secret exposure, data theft, or follow-on access through the software supply chain.

Failure mechanism: The attacker wins by abusing trust in names, repositories, or package resolution rules, then uses that trust to deliver malicious code or intercept sensitive material during install, build, or runtime use.

Impact: The organisation may ship compromised software, expose credentials or tokens, and create a durable supply-chain foothold that survives normal application-level review.

Standards & Framework Alignment

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

OWASP Non-Human Identity Top 10 and MITRE ATT&CK address the attack and risk surface, while CIS Controls v8 and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
CIS Controls v8 CIS 6 — Access Control Management Controls trusted access paths for package sources and repositories.
CIS 16 — Application Software Security Covers software supply-chain safeguards relevant to dependency intake.
CIS 15 — Service Provider Management Applies when external package and repository trust depends on third parties.
Recommendation — Restrict approved package sources and revoke unsafe repository access paths. Require provenance checks before promoting third-party dependencies. Vet third-party package providers and monitor ownership changes.
NIST CSF 2.0 PR.DS — Data Security Protects sensitive material that malicious dependencies may exfiltrate.
PR.IP — Information Protection Processes and Procedures Supports secure intake, review, and provenance processes for dependencies.
ID.SC — Supply Chain Risk Management Directly addresses trust, provenance, and third-party software sourcing.
Recommendation — Protect secrets and sensitive data from dependency-driven exposure. Define dependency intake procedures that verify source integrity. Assess and monitor software supplier trust before accepting packages.
OWASP Non-Human Identity Top 10 NHI-06 — Secret Exposure and Credential Lifecycle Poisoned dependencies can expose tokens or secrets during build or runtime.
NHI-08 — Third-Party and Supply-Chain Risk Covers the trust and provenance failures central to dependency confusion.
Recommendation — Rotate and protect secrets that dependencies can reach during execution. Verify third-party package provenance before allowing installation.
MITRE ATT&CK T1195 — Supply Chain Compromise Models adversary insertion through compromised dependencies and repositories.
T1195.001 — Compromise Software Dependencies and Development Tools Directly matches dependency confusion and poisoned dependency abuse.
Recommendation — Hunt for supply-chain compromise paths in dependency intake and builds. Monitor for malicious software dependency insertion and update abuse.

Practitioner Guidance

What to verify: Treat package selection as an access-control decision, not a convenience setting. Verify registry priority, source pinning, repository ownership, maintainer continuity, and whether the package is signed or otherwise provenance-verifiable before allowing it into production builds.

Common mistake: Relying on “known package name plus vulnerability scan” as the acceptance test. If your pipeline can fetch from a public namespace when you intended an internal one, or accepts a repo whose ownership has drifted, the control is incomplete even if the code is otherwise clean.

Practitioner takeaway: The key judgment is whether your supply chain can prove it selected the right artifact from the right source, because that assurance matters more here than a low vulnerability count.