You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allowlist for which packages are permitted to run scripts #9172
It seems like npm packages are getting compromised left and right. A major attack vector is vulnerable dependencies (e.g. plain-crypto-js) slipping into popular packages (e.g. axios) that are able to run scripts.
I realize that npm has ignore-scripts=true, but for many projects, this is unusable because they do need to run first-party or certain third-party scripts. (e.g. postinstall, sharp)
There are third-party packages like @lavamoat/allow-scripts that are a step in the right direction, but then you need to change from using npm install or npm ci to a different command like npm setup, which is unfortunate. This functionality also really feels like something that should be build into npm, not available via a dep.
Reacted by Brynn Crowley, Marcos Medrano, seanssel, Andrew Rasmussen, Atte Kemppilä, faulpeltz, mizdra, uva-sl, Yuki Adachi, Moe Shaaban and 6 more
Activity
FranciscoG commentedon Apr 1, 2026
All of the other major package managers have this already, npm should have this too.
pnpm has
onlybuiltdependencies: https://pnpm.io/settings#onlybuiltdependenciesyarn v4 has
dependenciesMeta: https://yarnpkg.com/configuration/manifest#dependenciesMetabun has
trustedDependencies: https://bun.com/docs/guides/install/trustedeverett1992 commentedon Apr 13, 2026
I wrote an RFC npm/rfcs#861 and am prepared to implement this
owlstronaut commentedon Apr 28, 2026
yes, RFCs are the best place to have this discussion