A build server fetched a public library with the same name as an internal one because the public version number was higher, and the build shipped it. Which control best prevents a recurrence while keeping public libraries usable?
Show the answer
Correct answerC. Restrict internal package names to the private repository and pin hashes
AWhy not this: DAST tests runtime behavior late in the cycle and does not govern dependency resolution.
BWhy not this: Version escalation is brittle; an attacker can publish an even higher version and win again.
CWhy this is right: Namespace-bound resolution plus hash pinning stops a same-named public package from being substituted.
DWhy not this: SAST analyzes your own source code and does not control which package the resolver downloads.
This is dependency confusion. Resolving internal names only from the private repository, with pinned hashes, removes the ambiguity while public libraries still resolve normally. Raising version numbers is a fragile race that an attacker can win again.