Skip to content

Commit e8fb281

Browse files
MatthiasKunnentimoxley
authored andcommittedAug 6, 2020
Test prototype pollution on unflatten
1 parent 6e95c43 commit e8fb281

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
 

‎test/test.js

+14
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,20 @@ suite('Unflatten', function () {
531531
})
532532
})
533533
}
534+
535+
test('should not pollute prototype', function () {
536+
unflatten({
537+
'__proto__.polluted': true
538+
});
539+
unflatten({
540+
'prefix.__proto__.polluted': true
541+
});
542+
unflatten({
543+
'prefix.0.__proto__.polluted': true
544+
});
545+
546+
assert.notStrictEqual({}.polluted, true);
547+
})
534548
})
535549

536550
suite('Arrays', function () {

0 commit comments

Comments
 (0)
Please sign in to comment.