[utils-extend] Prototype pollution
The utils-extend library's extend function allows an attacker to modify the prototype of a base object by supplying a crafted JSON payload with a __proto__ key. This can lead to denial of service, access to sensitive data, or remote code execution depending on how the library is used.
- Triaged in 3 hours
- Fixed in 41 days
- Disclosed after 41 days
NOTE! Thanks for submitting a report! Please replace all the [square] sections below with the pertinent details. Remember, the more detail you provide, the easier it is for us to triage and respond quickly, so be sure to take your time filling out the report!
I would like to report prototype polution in utils-extend
It allows an attacker to modify the prototype of a base object which can vary in severity depending on the implementation (DoS, access to sensitive data, RCE).
Module
module name: utils-extend
version: 1.0.8
npm page: https://www.npmjs.com/package/utils-extend
Module Description
Extend nodejs util api, and it is light weight and simple.
Module Stats
[1] weekly downloads : 129,956
Vulnerability
Vulnerability Description
Steps To Reproduce:
- npm install --save utils-extend
- create file index.js with content :
const { extend } = require('utils-extend');
const payload = '{"__proto__":{"isAdmin":true}}'
const emptyObject = {}
const pollutionObject = JSON.parse(payload);
extend({}, pollutionObject)
console.log(emptyObject.isAdmin) // true
- run
node index.js=> true
Wrap up
Select Y or N for the following statements:
- I contacted the maintainer to let them know: [Y/N] : N
- I opened an issue in the related repository: [Y/N] : N
Impact
Can result in: dos, access to restricted data, rce (depends on implementation)
Attachments

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 extend function recursively merges properties without filtering out the __proto__ key, allowing an attacker to modify Object.prototype.
Impact
Depending on how the library is used, this could lead to denial of service, access to restricted data, or remote code execution.
What the attacker needed
Attacker controls input passed to extend
How it was found
- Install the utils-extend package.
- Create a JavaScript file that parses a JSON payload containing a __proto__ key and passes it to the extend function.
- Run the file with Node.js and observe that the polluted property appears on an empty object.
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 lets an attacker change properties on a base object that other objects inherit from. Here, passing a crafted JSON payload with a __proto__ key to the extend function pollutes an empty object. This can break the application or, in worse cases, lead to code execution.
What is Prototype pollution?
Input changes JavaScript's shared object prototype, altering behaviour across the application, sometimes to XSS or code execution.