Denial of Service via `__proto__` header name in `req.headersDistinct` (Uncaught `TypeError` crashes Node.js process)
A request carrying a header named __proto__ makes the req.headersDistinct getter throw an uncaught TypeError, because the lookup resolves to Object.prototype instead of undefined. An attacker could crash a Node.js process that reads that property, causing denial of service.
Originally disclosed on HackerOne
- Triaged in 26 hours
- Fixed in 34 days
- Disclosed after 40 days
Summary by the program
A flaw in Node.js HTTP request handling causes an uncaught TypeError when a request is received with a header named __proto__ and the application accesses req.headersDistinct.
When this occurs, dest["__proto__"] resolves to Object.prototype rather than undefined, causing .push() to be called on a non-array. This exception is thrown synchronously inside a property getter and cannot be intercepted by error event listeners, meaning it cannot be handled without wrapping every req.headersDistinct access in a try/catch.
- This vulnerability affects all Node.js HTTP servers on 20.x, 22.x, 24.x, and v25.x
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the header-collection code uses a plain object and writes to dest["__proto__"] without an own-property check, so the inherited Object.prototype is treated as an array.
Impact
A single crafted request could crash a Node.js HTTP server that reads req.headersDistinct, and the exception cannot be caught by error event listeners, so it may only be mitigated by wrapping every such access in a try/catch.
What the attacker needed
Server reads req.headersDistinct; attacker can send HTTP requests
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Every JavaScript object inherits from a built-in object called Object.prototype, and the special name __proto__ points at it. The server code expected that name to be empty, so it tried to add an item to something that was not a list and crashed. Because the crash happens while a value is being read, the usual error handlers never get a chance to catch it, so the whole server process can go down.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.