npm runs install scripts from packages automatically (‹path›)
What this means
By default, npm install runs scripts that packages ship (preinstall, install, postinstall) with your account's full access. That is how the 2025-2026 npm worms spread: one poisoned release of a popular package ran a script on every machine that installed it and copied tokens, SSH keys and cloud credentials. Your user settings (‹path›) do not turn this off.
How to fix it
Turn install scripts off for your account, then allow them only where a project needs them.
- Run
npm config set ignore-scripts true. - If a package needs its build step (for example a native module), run it on purpose:
npm rebuild <package>inside that project. - Commands you start yourself, such as
npm testandnpm run build, keep working.
Check it yourself
Run a scan and look for BLWK-DEV-010 in the results:
bulwark scanInstalled the standalone CLI package instead of the app? The command is bulwarkctl.
How Bulwark decides
Bulwark reads dev_tool_config and reports this check when:
kind == "npm_user" and install_scripts_auto == trueIf a value can't be read, Bulwark reports the check as undetermined rather than passing it. View the rule source.
References
Related checks
- Git skips TLS certificate checks (‹path›) ·
BLWK-DEV-001 - Git trusts repositories owned by anyone (‹path›) ·
BLWK-DEV-002 - Git allows the ext:: transport, which runs commands from a URL (‹path›) ·
BLWK-DEV-003 - SSH doesn't check server identities (‹path›) ·
BLWK-DEV-004 - SSH forwards your agent to every server (‹path›) ·
BLWK-DEV-005 - npm/yarn installs packages without checking TLS certificates (‹path›) ·
BLWK-DEV-006