CVE-2020-28460 (published 2020-12-22T13:15Z)

This affects the package multi-ini before 2.1.2. It is possible to pollute an object's prototype by specifying the constructor.proto object as part of an array. This is a bypass of CVE-2020-28448.

Severity: HIGH
CVSS v2 base score: 7.5 (AV:N/AC:L/Au:N/C:P/I:P/A:P)
CVSS v3 base score: 8.1, HIGH (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H)

Weakness information:
cwe_id: CWE-1321
cwe_name: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')
description: The product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype.
extended_description: 
				By adding or modifying attributes of an object prototype, it is possible to create attributes that exist on every object, or replace critical attributes with malicious ones. This can be problematic if the product depends on existence or non-existence of certain attributes, or uses pre-defined attributes of object prototype (such as hasOwnProperty, toString or valueOf).
				This weakness is usually exploited by using a special attribute of objects called proto,  constructor or prototype. Such attributes give access to the object prototype. This weakness is often found in code that assigns object attributes based on user input, or merges or clones objects recursively.
			
			

Fix information:
repo_url: https://github.com/evangelion1204/multi-ini
commit_details: repo_url: https://github.com/evangelion1204/multi-ini
author: Michael Iwersen
author_date: 2020-12-19 20:51:19+01:00
msg: Fixed 2nd issue with prototype pollution
repository: repo_url: https://github.com/evangelion1204/multi-ini
repo_name: evangelion1204/multi-ini
description: Read multilevel and multiline ini files in compatible with Zend.
repo_language: JavaScript
owner: evangelion1204
file_changes: filename: README.md
change_type: ModificationType.MODIFY
diff: @@ -137,6 +137,12 @@ content = serializer.serialize({
 
 ## Changelog
 
+### 2.1.2
+* Fixed prototype pollution by ignoring `constructor`
+
+### 2.1.1
+* Fixed prototype pollution by ignoring `__proto__`
+
 ### 1.0.1
 * Fixed bug with `keep_quotes` ignored when writing files
 

programming_language: Markdown
filename: package.json
change_type: ModificationType.MODIFY
diff: @@ -1,6 +1,6 @@
 {
   "name": "multi-ini",
-  "version": "2.1.1",
+  "version": "2.1.2",
   "license": "MIT",
   "description": "An ini-file parser which supports multi line, multiple levels and arrays to get a maximum of compatibility with Zend config files.",
   "main": "lib/index.js",

programming_language: JavaScript
filename: parser.js
change_type: ModificationType.MODIFY
diff: @@ -20,7 +20,7 @@ const defaults = {
     constants: {},
 };
 
-const REGEXP_IGNORE_KEYS = /__proto__/;
+const REGEXP_IGNORE_KEYS = /__proto__|constructor|prototype/;
 
 class Parser {
     constructor(options = {}) {

programming_language: JavaScript
filename: prototype_pollution.ini
change_type: ModificationType.MODIFY
diff: @@ -3,4 +3,8 @@ value=key
 [__proto__]
 polluted="polluted"
 [other]
-__proto__.path_polluted="polluted"
\ No newline at end of file
+__proto__.path_polluted="polluted"
+[constructor]
+prototype.polluted = polluted
+[prototype]
+polluted = polluted
\ No newline at end of file

programming_language: CoffeeScript