Safeguard
Tag

npm

Safeguard articles tagged "npm" — guides, analysis, and best practices for software supply chain and application security.

195 articles

Open Source

npm handlebars: A Security Review and Safe Usage Guide

The npm handlebars package is a widely used templating engine with a history of prototype pollution issues. Here is what to know before you depend on it and how to use it safely.

Mar 24, 20266 min read
Emerging Technology

npm Garbage Collection Abuse: Attack Research

npm's unpublish and tarball retention rules create a narrow but real window for attackers to reclaim deleted names and swap tarball contents. Here is the 2025 research.

Mar 23, 20268 min read
Supply Chain

cross-env and the crossenv Typosquat: A Supply Chain Case Study

In 2017, a malicious crossenv package on npm stole environment variables from developers who mistyped cross-env. The incident is still the cleanest case study in typosquatting we have.

Mar 21, 20267 min read
Supply Chain

node-pre-gyp and node-gyp: The Security Cost of Native Modules

@mapbox/node-pre-gyp downloads compiled binaries into your node_modules at install time. Understanding that machinery is the difference between a fast install and an unauditable one.

Mar 21, 20267 min read
Open Source

npm uninstall package: How to Safely Remove Dependencies

How the npm uninstall package command works, what it leaves behind, and how to confirm a removed dependency is actually gone from your tree and your risk surface.

Mar 21, 20266 min read
Open Source

minimatch npm: Security Review and Safe Usage

The minimatch npm package powers glob matching across the JavaScript ecosystem, and a ReDoS flaw made older versions a denial-of-service risk. Here is what to know and how to stay safe.

Mar 21, 20265 min read
AppSec

The xss npm Package: Sanitizing HTML Input Correctly

The xss npm package is a whitelist-based HTML sanitizer for Node and the browser. It works well — when you sanitize in the right place, with the right whitelist, for the right output context.

Mar 21, 20267 min read
Concepts

What is a Package Registry Mirror

A package registry mirror is a local copy or caching proxy of a public registry. It keeps builds running when npm is down — and controls what enters your supply chain.

Mar 18, 20266 min read
Best Practices

How to Prevent Dependency Confusion in npm (2026)

Dependency confusion attacks are still landing in 2026 because scoped packages, registry config, and provenance checks are misconfigured by default. Here is the fix.

Mar 13, 20267 min read
Concepts

What is Dependency Pinning

Dependency pinning locks every package in your build to an exact, verified version so the code you tested is the code you ship. Here's how to do it per ecosystem.

Mar 11, 20266 min read
Tools

Best Practices for npm Lockfile Security 2026

Your package-lock.json is a supply chain control, not build noise. Six habits — npm ci, script blocking, lockfile linting, provenance checks — that stop most npm attacks cold.

Mar 10, 20266 min read
Licensing

Node.js License: What Actually Applies to Your App

Node.js itself ships under a permissive MIT-style license, but your app's real license exposure comes from the hundreds of npm packages riding along with it.

Mar 9, 20264 min read

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.

npm (Page 12) — Safeguard Blog