Adventures in Nodeland
Read post

No, We Can't Harden Node.js Against Prototype Pollution

Matteo Collina, Node.js TSC member, argues that hardening Node.js core against prototype pollution gadgets is structurally impossible. Once an attacker can write to Object.prototype, the game is already over — any gadget found in core or a library is just one of infinitely many exit points. Primordials protect Node's own integrity but don't secure application objects. The real fix is at the input boundary: use secure-json-parse to reject __proto__ and constructor.prototype keys before they enter the process, prefer Maps for untrusted keys, and use null-prototype objects for attacker-controlled data. Node.js does not accept prototype pollution in core as a vulnerability in its bug bounty program for this reason.

    #javascript#nodejs#appsec
Jul 19•7m read time•From adventures.nodeland.dev
Post cover image
Table of contents
Read the preconditionWhy you can't win the whack-a-molePrimordials are integrity, not securityThis is why it isn't a vulnerabilityThe fix lives at the boundary, and it always didWhy this matters to me
481.3K Impressions2 Comments
Adventures in Nodeland's image
Adventures in Nodeland

Nodeland's platform is a central hub for Node.js developers, offering insights into server-side Java...

146 Followers

•

1.5K Upvotes

Would you recommend this post?

Copy link
WhatsApp
Facebook
X
New Squad
  • © 2026 Daily Dev Ltd.
  • Guidelines
  • Explore
  • Tags
  • Sources
  • Squads
  • Leaderboard