SK-2839: harden against npm supply chain attacks — pin deps and add --ignore-scripts to CI#137
Open
saileshwar-skyflow wants to merge 1 commit into
Open
Conversation
…ore-scripts to CI - Pin all ^/~ version ranges in package.json and example/package.json to exact lockfile-resolved versions (yarn.lock source of truth) - Add --ignore-scripts to all npm install steps in CI workflows to block arbitrary postinstall execution from compromised packages - Create .npmrc with comment explaining why ignore-scripts=true was omitted globally (example/postinstall=patch-package is a legitimate required hook) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
✅ Gitleaks Findings: No secrets detected. Safe to proceed! |
|
Semgrep findings: No issues found, Good to merge. |
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
package.jsonandexample/package.json— removes all^/~ranges and replaces with exact versions resolved fromyarn.lock.peerDependenciesandresolutionsare untouched.--ignore-scriptsto all 5 CInpm installsteps (CI.yml,main.yml,release.yml,beta-release.yml,internal-release.yml) to block arbitrary postinstall execution from a compromised package. Each step gets a comment explaining the rationale and exceptions..npmrcwith a comment block explaining whyignore-scripts=truewas not set globally —example/package.jsonhas a legitimatepostinstall: "patch-package"hook required for dependency patches.No source files, test files, config files, or native code (
android/,ios/,assets/) were modified.Postinstall audit findings
package.json(root)prepare: "bob build"npm run buildexplicitlyexample/package.jsonpostinstall: "patch-package"@arkweid/lefthookreact-native0.71.xSemgrep.ymlandGitleaks.ymlhave nonpm installsteps and were not modified.