Security Operations

A popular open-source package's maintainer account was hijacked, and a malicious patch release was published. Within an hour, CI builds of several services pulled it, because their manifests declare version ranges and no lockfile is committed. Which practice would have kept the builds on the reviewed version?

Show the answer

Correct answerD. Committing lockfiles with pinned versions and hashes, updated only by review

AWhy not this: Static analysis examines the code the team wrote and does not control which dependency versions a build pulls in.

BWhy not this: An SBOM records which versions went into a build, including a malicious one, but does not stop the build resolving it.

CWhy not this: Signing proves the team released the artifact unaltered, even when it already contains the malicious package.

DWhy this is right: Pinned versions and hashes keep builds on reviewed releases, so a new upstream release enters only through a reviewed update.

Version ranges let a build resolve whatever release is newest, so a hijacked release flows straight in. A committed lockfile pins each direct and transitive dependency to an exact version and integrity hash, so new releases enter only through a reviewed update. An SBOM would record the malicious version but not stop it being pulled.