惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Vercel News
Vercel News
博客园 - 司徒正美
C
Check Point Blog
G
Google Developers Blog
The GitHub Blog
The GitHub Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
有赞技术团队
有赞技术团队
P
Proofpoint News Feed
IT之家
IT之家
B
Blog
博客园_首页
量子位
MongoDB | Blog
MongoDB | Blog
博客园 - Franky
J
Java Code Geeks
H
Help Net Security
A
About on SuperTechFans
Apple Machine Learning Research
Apple Machine Learning Research
Jina AI
Jina AI
D
DataBreaches.Net
Y
Y Combinator Blog
大猫的无限游戏
大猫的无限游戏
云风的 BLOG
云风的 BLOG
Google DeepMind News
Google DeepMind News

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Protecting your Node.js project against supply-chain attacks
Douglas Mour · 2026-05-17 · via DEV Community

Several recent supply-chain incidents have hit widely used npm packages. The TanStack compromise, for example, affected 42 packages and 84 published versions in May 2026. A few weeks earlier, the Axios compromise published malicious axios@1.14.1 and axios@0.30.4 releases.

Many malicious releases are detected and removed within hours. Delaying dependency resolution gives the ecosystem time to catch bad versions before your project installs them. It is not a complete defense, but it is a small setting with a good payoff.

npm 11.10+, Yarn 4.10+, and pnpm 10.16+ support release-age gates. pnpm 11 also sets a 24-hour cooldown by default.

npm

npm calls the setting min-release-age, and the value is in days:

npm config set min-release-age=1 --location=project

Enter fullscreen mode Exit fullscreen mode

This writes min-release-age=1 to the project's .npmrc. You can also use --location=user or --location=global to write to your user or global npm configuration.

Yarn (Berry 4.10+)

Yarn calls the setting npmMinimalAgeGate. In Yarn 4.10, use minutes:

yarn config set npmMinimalAgeGate 1440

Enter fullscreen mode Exit fullscreen mode

This writes npmMinimalAgeGate: 1440 to the project's .yarnrc.yml. Add --home to write to ~/.yarnrc.yml instead.

Current Yarn versions also accept duration strings, so this is equivalent:

yarn config set npmMinimalAgeGate 1d

Enter fullscreen mode Exit fullscreen mode

pnpm

pnpm calls the setting minimumReleaseAge, and the value is in minutes:

pnpm config set --location=project minimumReleaseAge 1440

Enter fullscreen mode Exit fullscreen mode

This writes minimumReleaseAge: 1440 to pnpm-workspace.yaml. Use --location=global if you want to write to the global pnpm configuration instead.

If you are already on pnpm 11, this is the default. Setting it explicitly can still be useful because it documents the policy in the repository and keeps older pnpm 10.16+ installs protected.

A note for Dependabot and Renovate users

The package-manager settings above are enforced when dependencies are installed or resolved. Dependency update bots make their own decisions before that point, so configure them too.

For Dependabot, use cooldown in dependabot.yml:

cooldown:
  default-days: 1

Enter fullscreen mode Exit fullscreen mode

Dependabot cooldowns apply to version updates, not security updates.

For Renovate, set minimumReleaseAge:

{
  "minimumReleaseAge": "1 day"
}

Enter fullscreen mode Exit fullscreen mode

Renovate also bypasses minimumReleaseAge for security updates.

A word of caution

Keep committing your lockfile and use deterministic installs in CI, such as npm ci, pnpm install --frozen-lockfile, or yarn install --immutable. A release-age gate reduces the chance of pulling a brand-new malicious version, but it will not clean up a compromised lockfile or make an already-installed bad version safe.