A company uses a private artifact registry for internal packages. An attacker publishes a malicious package with the same name as an internal package to a public registry. Which attack is being described?
This attack exploits package managers that default to public registries over private ones.
Why this answer
This is a dependency confusion attack, where an attacker uploads a malicious package to a public registry (e.g., npm, PyPI, Maven Central) using the same name as a private package used internally by the target organization. When a build system or developer's package manager is configured to check public registries first (or as a fallback), it may download the attacker's malicious version instead of the legitimate internal package, leading to code execution or data exfiltration.
Exam trap
Cisco often tests the distinction between 'dependency confusion' and 'supply chain poisoning' by making them sound similar, but dependency confusion is a specific subtype where the attacker exploits name collision between public and private registries, not a generic compromise of the supply chain.
How to eliminate wrong answers
Option B (Supply chain poisoning) is wrong because supply chain poisoning is a broader category that includes any compromise of the software supply chain (e.g., injecting malicious code into a legitimate package, compromising build servers), not specifically the act of publishing a package with the same name as an internal one to a public registry. Option C (Typosquatting) is wrong because typosquatting relies on a user mistyping a package name (e.g., 'requsts' instead of 'requests'), not on the exact same name as an internal package. Option D (Man-in-the-middle attack) is wrong because a MITM attack intercepts network traffic between the client and registry (e.g., via ARP spoofing or rogue TLS proxy), not by publishing a package to a public registry.