Packages / @fastify/busboy / Security
@fastify/busboy vulnerable to Denial of Service via prototype-named multipart part header
Affected releases · @fastify/busboy
- 3.x3.0.0 – 3.2.0Fixed in 3.2.1
- 2.x and older1.0.0 – 2.1.1No fix, no longer updated
On 3.x, the newest line:
npm install @fastify/busboy@3.2.1Every release on a timeline
Affected
3.0.0 – 3.2.0
4 releases
Fixed
3.2.1 – 3.2.6
6 releases, latest
Affected
2.0.0 – 2.1.1
3 releases
Affected
1.0.0 – 1.2.1
4 releases
What happens
Impact
Versions of @fastify/busboy from 1.0.0 and prior to 3.2.1 are vulnerable to a Denial of Service. The multipart header parser stores part-header names on a plain JavaScript object, so a part header named __proto__ or constructor resolves to an inherited value that is not an array, and the parser throws TypeError: this.header[h].push is not a function. Through the documented req.pipe(busboy) integration this surfaces as an error event, while direct write()/end() usage throws synchronously and can terminate the Node.js process if uncaught. The parser runs before application middleware, so any unauthenticated client that can submit multipart/form-data is affected.
Patches
Fixed in version 3.2.1.
Workarounds
Attach an error listener to the Busboy stream so the parser failure is handled rather than crashing the process, and wrap direct write()/end() calls in a try/catch. Upgrading to 3.2.1 removes the failure entirely.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.