fix: pin npm to specific version in create-release workflow#17
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Semgrep found 1 $...LIB |
|
|
||
| - name: Install npm | ||
| run: npm install -g npm@latest | ||
| run: npm install -g npm@11.7.0 |
There was a problem hiding this comment.
$...LIB
An npm script inside an action on GitHub is not pinned to a full length commit SHA. Pinning the npm package to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload.
⭐ Fixed in commit 3efa945 ⭐
There was a problem hiding this comment.
/ar Pinning npm itself to a git commit SHA is not practical — it's the package manager, not a third-party dependency. Version pinning to @11.7.0 is sufficient.
|
|
||
| - name: Install npm | ||
| run: npm install -g npm@latest | ||
| run: npm install -g npm@11.7.0 |
There was a problem hiding this comment.
$...LIB
An npm script inside an action on GitHub is not pinned to a full length commit SHA. Pinning the npm package to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload.
🌟 Fixed in commit 3efa945 🌟
|
Semgrep found 1 $...LIB |
Use github:npm/cli#<sha> to bypass the npm registry entirely, preventing supply chain attacks on the package manager itself. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
Pin
npm@latesttonpm@11.7.0in the create-release workflow to prevent automatically pulling compromised versions of npm or its dependencies.What changed
.github/workflows/create-release.yaml: Changednpm install -g npm@latesttonpm install -g npm@11.7.0Motivation
The axios npm supply chain compromise (2026-03-30) demonstrated the risk of using unpinned
@latesttags in CI pipelines. An attacker who publishes a malicious version to npm can immediately compromise any workflow that installs@latest. Pinning to a known-good version eliminates this attack vector.Test plan
npm@11.7.0is a valid, uncompromised release🤖 Generated with Claude Code