Skip to content

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
mainfrom
saileshwar/SK-2839-pin-versions-and-add-ignore-scripts
Open

SK-2839: harden against npm supply chain attacks — pin deps and add --ignore-scripts to CI#137
saileshwar-skyflow wants to merge 1 commit into
mainfrom
saileshwar/SK-2839-pin-versions-and-add-ignore-scripts

Conversation

@saileshwar-skyflow
Copy link
Copy Markdown
Collaborator

@saileshwar-skyflow saileshwar-skyflow commented Jun 3, 2026

Summary

  • Pin all dependency versions in package.json and example/package.json — removes all ^/~ ranges and replaces with exact versions resolved from yarn.lock. peerDependencies and resolutions are untouched.
  • Add --ignore-scripts to all 5 CI npm install steps (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.
  • Create .npmrc with a comment block explaining why ignore-scripts=true was not set globally — example/package.json has a legitimate postinstall: "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

Location Hook Decision
package.json (root) prepare: "bob build" Safe to suppress — CI runs npm run build explicitly
example/package.json postinstall: "patch-package" Legitimate — not suppressed (root install doesn't trigger it)
@arkweid/lefthook git hook installer Not needed in CI
react-native 0.71.x native postinstall Not needed — CI is JS-only

Semgrep.yml and Gitleaks.yml have no npm install steps and were not modified.

…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>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

Gitleaks Findings: No secrets detected. Safe to proceed!

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

Semgrep findings: No issues found, Good to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant