Briefing

safe‑install: npm Package to Disable Install Scripts and Whitelist Dependencies

release
by gkiely ·

Install @gkiely/safe‑install and configure npm to disable install scripts by default.

What to do now

Install @gkiely/safe‑install and configure your npm scripts to disable install scripts by default.

Summary

In response to ongoing npm supply‑chain compromises, developer gkiely released the @gkiely/safe‑install package on npm. The tool disables install scripts by default, mirroring Bun’s trusted dependencies feature, and allows developers to define a whitelist of dependencies that may run build or install scripts. It also supports blocking exotic sub‑dependencies, similar to pnpm’s blockExoticSubdeps setting, providing an extra layer of protection against malicious packages. The package is available at https://npmjs.com/package/@gkiely/safe‑install and can be integrated into existing npm workflows. It addresses a gap in npm’s built‑in security features, which currently lack script‑execution controls. By using safe‑install, teams can mitigate the risk of supply‑chain attacks without altering their package.json structure. The tool is lightweight, requiring only a single dependency and a configuration file. It is ideal for projects that prioritize security and wish to enforce strict dependency policies.

Key changes

  • safe‑install disables install scripts by default.
  • Allows whitelisting of dependencies that can run build/install scripts.
  • Supports blocking exotic sub‑dependencies.
  • Provides similar functionality to Bun’s trusted dependencies and pnpm’s blockExoticSubdeps.

Affects

internal

Customer impact

Analyzing matches…

Ask about this story

Impact on an agency? Which customers? Compare historically Risks of waiting