Skip to content

Commit

Permalink
Fixed 2nd issue with prototype pollution
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Iwersen committed Dec 19, 2020
1 parent 49d6027 commit 3c7e751
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const defaults = {
constants: {},
};

const REGEXP_IGNORE_KEYS = /__proto__/;
const REGEXP_IGNORE_KEYS = /__proto__|constructor/;

class Parser {
constructor(options = {}) {
Expand Down
4 changes: 3 additions & 1 deletion test/data/prototype_pollution.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ value=key
[__proto__]
polluted="polluted"
[other]
__proto__.path_polluted="polluted"
__proto__.path_polluted="polluted"
[constructor]
prototype.polluted = polluted

0 comments on commit 3c7e751

Please sign in to comment.