security: harden npm install against supply chain attacks#512
Closed
security: harden npm install against supply chain attacks#512
Conversation
- Add npm cache clean --force before install to prevent stale/malicious cached tarballs - Add --ignore-scripts to block malicious postinstall hooks (e.g. axios CVE) - Remove --silent to make installed versions visible in logs Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Orca Security Scan Summary
| Status | Check | Issues by priority | |
|---|---|---|---|
| Infrastructure as Code | View in Orca | ||
| OSS Licenses | View in Orca | ||
| SAST | View in Orca | ||
| Secrets | View in Orca | ||
| Vulnerabilities | View in Orca |
EladKohavi
approved these changes
Apr 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
npm cache clean --forcebefore install to prevent stale/malicious cached tarballs--ignore-scriptsto block malicious postinstall hooks (e.g. axios supply chain CVE)--silentto make installed package versions visible in logsContext
In response to the axios npm supply chain compromise (March 31, 2026), where attackers published backdoored versions
1.14.1and0.30.4via a hijacked maintainer account. The malicious versions used apostinstallhook to deploy a cross-platform RAT.--ignore-scriptsensures postinstall hooks are never executed regardless of what version is installed.Test plan
npm cache clean --forceappears in logsadded N packagesoutput is visible (no --silent)🤖 Generated with Claude Code
✨ PR Description
Purpose: Harden npm package installation process to prevent supply chain attacks by disabling script execution and clearing cached packages.
Main changes:
Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Description using Guidelines Learn how