Skip to content

Commit

Permalink
Test prototype pollution on unflatten
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthiasKunnen authored and timoxley committed Aug 6, 2020
1 parent 6e95c43 commit e8fb281
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,20 @@ suite('Unflatten', function () {
})
})
}

test('should not pollute prototype', function () {
unflatten({
'__proto__.polluted': true
});
unflatten({
'prefix.__proto__.polluted': true
});
unflatten({
'prefix.0.__proto__.polluted': true
});

assert.notStrictEqual({}.polluted, true);
})
})

suite('Arrays', function () {
Expand Down

0 comments on commit e8fb281

Please sign in to comment.