One dev dependency is pinned to any version. The next release your registry serves, safe or not, is the code your test script runs.
What goes wrong
A build-time dependency is declared with a wildcard version, so install resolves to whatever the registry currently serves as newest. There is no ceiling and no lock to a reviewed release. Tomorrow's version, which nobody on your team has seen, is fair game.
That dependency ships an executable your test script calls. If the maintainer account is compromised or the package is taken over, the attacker publishes a new release, your next install pulls it, and the script runs it. The code executes wherever the script runs, on a developer's machine or a CI runner, anywhere with your source and often your secrets.
Wildcards feel convenient because you never think about upgrades. That is the problem. You have delegated the choice of which code to run to whoever can publish to that package, and you have agreed to accept it sight unseen.
The pattern
// dependency manifest
devDependencies:
build-tool: '*' // any release, chosen at install time
// a script then runs its binary
scripts:
test: build-tool rundevDependencies:
build-tool: '3.2.1' // exact, reviewed version
// plus a committed lockfile with integrity hashes,
// upgrades land through a reviewed changeGrounding and reachability were confirmed. The exploit-path gate would not conclude without the calling code, so the finding was held and an evidence request was raised instead of being reported as fact.
Why it matters to you
Dependency takeover is a routine supply-chain attack now, and dev tooling is a soft target because it runs with less scrutiny than production code. A wildcard on anything that executes turns a compromised upstream release into code running in your build. Pin exact versions and commit a lockfile with integrity hashes. Make every upgrade a reviewed change instead of an automatic one.
Check your own code
- Search manifests for wildcard or unbounded version ranges, especially on tools that execute.
- Pin build and dev dependencies to exact versions.
- Commit a lockfile with integrity hashes and enforce it in CI.
- Route dependency upgrades through review, not automatic resolution at install time.