Prototype pollution in multipart parsing
The fastify-multipart plugin was vulnerable to prototype pollution when parsing multipart requests, allowing a specially crafted request to crash a remote server. The issue was fixed in version 1.0.5.
- Fixed in 3 days
- Disclosed after 3 days
I would like to report a prototype pollution attack in fastify-multipart it allows to crash a remote server parsing multipart requests by sending a specially crafted request.
Module
module name: fastify-multipart
version: all versions before < v1.0.5. v1.0.5 contains the fix.
npm page: https://www.npmjs.com/package/fastify-multipart
Module Description
Fastify plugin to parse the multipart content-type.
Under the hood it uses busboy.
Module Stats
weekly downloads: 4900
Vulnerability
Vulnerability Description
Eran Hammer found this vulnerability for Hapi, he tested Fastify as well and found it vulnerable. Here is the Hapi vulnerability report: https://www.npmjs.com/advisories/1479.
Steps To Reproduce:
Detailed steps to reproduce with all required references/steps/commands. If there is any exploit code or reference to the package source code this is the place where it should be put.
Patch
This was already released in https://github.com/fastify/fastify-multipart/pull/116 and version 1.0.5 issued.
Wrap up
Select Y or N for the following statements:
- I contacted the maintainer to let them know: Y
- I opened an issue in the related repository: N
I just need a CVE issued.
Impact
It's a Denial of Service attack
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 multipart parser did not safely handle field names that could modify object prototypes.
Impact
A remote attacker could crash the server, causing a denial of service.
What the attacker needed
Send a crafted multipart request
The fix
It was fixed in version 1.0.5 via a pull request.
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.
Prototype pollution is a flaw where an attacker can sneak extra properties into a shared object that many parts of a program rely on. Here, a malformed multipart request could alter that shared object and make the server crash, so the result is a denial of service.
What is Prototype pollution?
Input changes JavaScript's shared object prototype, altering behaviour across the application, sometimes to XSS or code execution.