From CISO Marketplace — the hub for security professionals Visit

Dependency Confusion Attack

Network Security

Definition

A supply chain attack exploiting package manager resolution priority by publishing a malicious public package with the same name as a private internal dependency, causing build systems to download the attacker's version.

Technical Details

Package managers (npm, pip, RubyGems, NuGet) typically prefer public registry packages over private ones when the same name and a higher version number are used. Attackers discover internal package names through leaked dependency files and upload malicious public packages with high version numbers. Mitigations include using scoped packages, configuring registries to prefer private sources, and SBOM-based dependency pinning.

Practical Usage

Development teams must audit all internal package names against public registries and configure dependency management to pin exact versions from trusted sources. CI/CD pipelines should enforce dependency integrity checking (hash pinning) and reject packages not in an approved SBOM.

Examples

Related Terms

Package Manager Poisoning SLSA Framework Software Bill of Materials (SBOM) Security Supply Chain Attack CI/CD Pipeline Security
← Back to Glossary