This repository contains a vulnerable code example that demonstrates the prototype pollution vulnerability in Node.js.
The prototype pollution vulnerability allows an attacker to manipulate the prototype of objects, which can lead to unexpected behavior and security issues. In the context of Node.js, the extend
function in the vulnerable code example is susceptible to prototype pollution.
By merging objects with user-controlled data, an attacker can pollute the prototype of the target object, leading to potential security breaches.
To run the vulnerable code example, follow these steps:
- Clone the repository to your local machine.
git clone https://github.com/TheWation/NodeJsPrototypePollutionLab
- Run the vulnerable code:
node main.js
This will execute the vulnerable code that showcases the prototype pollution vulnerability using the custom extend
function.
- Verify the output to observe the impact of the prototype pollution.
This repository is for educational purposes only. The vulnerable code example is provided to demonstrate the impact of the prototype pollution vulnerability. It is important to address such vulnerabilities and follow secure coding practices in real-world applications.
For more information on the prototype pollution vulnerability and secure coding practices, refer to the official documentation and security resources.
NodeJsPrototypePollutionLab
is made with โฅ by Wation and it's released under the Apache License 2.0
license.