Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS12cTMzLTI2cHItcjRoNs4AAnA7

flattenizer vulnerable to prototype pollution

Overview

Prototype pollution vulnerability in ‘flattenizer’ versions 0.0.5 through 1.0.5 allows an attacker to cause a denial of service and may lead to remote code execution.

Details

The NPM module 'flattenizer' can be abused by Prototype Pollution vulnerability since the function 'unflatten()' did not check for the type of object before assigning value to the property. Due to this flaw an attacker could create a non-existent property or able to manipulate the property which leads to Denial of Service or potentially Remote code execution.

PoC Details

There is no validation before assigning the property to check whether the assigned argument is the Object's own property or not, the property polluted will be directly be assigned thereby polluting the Object prototype. Later in the code, if there is a check to validate polluted the valued would be substituted as "true" as it had been polluted.

var flattenizer = require("flattenizer")
flattenizer.unflatten({'__proto__.polluted': true});
console.log(polluted);
Permalink: https://github.com/advisories/GHSA-vq33-26pr-r4h6
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS12cTMzLTI2cHItcjRoNs4AAnA7
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Critical
Classification: General
Published: about 2 years ago
Updated: about 2 months ago


CVSS Score: 9.8
CVSS vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Identifiers: GHSA-vq33-26pr-r4h6, CVE-2020-28279
References: Repository: https://github.com/sahellebusch/flattenizer
Blast Radius: 11.2

Affected Packages

npm:flattenizer
Dependent packages: 4
Dependent repositories: 14
Downloads: 5,152 last month
Affected Version Ranges: >= 0.0.5, <= 1.0.5
Fixed in: 1.1.1
All affected versions: 0.0.5, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.0.5
All unaffected versions: 0.0.1, 0.0.2, 1.1.0, 1.1.1, 1.1.2, 1.1.3