Skip to content

Add .npmrc ignore-scripts=true (Miasma install-hook mitigation)#1471

Merged
dbutts29 merged 3 commits into
masterfrom
darrenbutts/PLA-1580/ignore-scripts-npmrc
Jun 12, 2026
Merged

Add .npmrc ignore-scripts=true (Miasma install-hook mitigation)#1471
dbutts29 merged 3 commits into
masterfrom
darrenbutts/PLA-1580/ignore-scripts-npmrc

Conversation

@dbutts29

@dbutts29 dbutts29 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Description of the change

Adds a repo-local .npmrc containing ignore-scripts=true so npm does not auto-execute dependency lifecycle scripts (preinstall/install/postinstall) on npm install. This blocks the execution mechanism used by the Miasma / Shai-Hulud npm supply-chain worm.

Config-only change. Explicit npm run <script> invocations are unaffected; only automatic install-time lifecycle scripts are suppressed. Part of a fleet-wide rollout tracked in Linear PLA-1580 (one PR per repo).

Type of change

  • Maintenance

Related issues

Checklists

Development

  • N/A — configuration-only change, no code or tests affected

Code review

  • This pull request has a descriptive title and information useful to a reviewer
  • Issue from task tracker has a link to this pull request

Prevents npm from auto-running dependency lifecycle scripts (preinstall/install/postinstall) on install, mitigating the Miasma/Shai-Hulud npm supply-chain worm class.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dbutts29 dbutts29 self-assigned this Jun 9, 2026
@linear-code

linear-code Bot commented Jun 9, 2026

Copy link
Copy Markdown

PLA-1580

dbutts29 and others added 2 commits June 12, 2026 14:05
`.npmrc` ignore-scripts=true blocks malicious dependency install hooks (the
Miasma mitigation) but also suppresses npm's own pre/post run-script hooks, so
`npm run build` ran webpack while the `postbuild` hook (validate:es5 +
update:snippets + pack) silently never fired. Result: no examples/rollbar.tgz,
and the "Validate examples" CI step failed on every leg.

Replace the `postbuild` / `postbuild:dev` auto-hooks with an explicit
`build:finalize` step invoked from `build` and `build:dev`. Explicit `npm run`
invocations still execute under ignore-scripts (only the implicit pre/post hooks
are blocked), so the tgz is produced again — without re-enabling install hooks.
No double-run in normal environments since the hook names are gone.

Verified locally with ignore-scripts active: `npm run build` produces
examples/rollbar.tgz and `npm run validate:examples` passes all 15 examples.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dbutts29 dbutts29 merged commit 0b44c41 into master Jun 12, 2026
7 checks passed
@dbutts29 dbutts29 deleted the darrenbutts/PLA-1580/ignore-scripts-npmrc branch June 12, 2026 21:37
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.

2 participants