Skip to content

Commit 6ed45bb

Browse files
MatthiasKunnentimoxley
authored andcommitted
Test prototype pollution on unflatten
1 parent 32432dd commit 6ed45bb

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/test.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,20 @@ suite('Unflatten', function () {
470470
})
471471
})
472472
}
473+
474+
test('should not pollute prototype', function () {
475+
unflatten({
476+
'__proto__.polluted': true
477+
});
478+
unflatten({
479+
'prefix.__proto__.polluted': true
480+
});
481+
unflatten({
482+
'prefix.0.__proto__.polluted': true
483+
});
484+
485+
assert.notStrictEqual({}.polluted, true);
486+
})
473487
})
474488

475489
suite('Arrays', function () {

0 commit comments

Comments
 (0)