Skip to content

Commit bc8ecee

Browse files
author
substack
committedMar 22, 2022
test from prototype pollution PR
1 parent aeb3e27 commit bc8ecee

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
 

‎test/proto.js

+16
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,19 @@ test('proto pollution (constructor)', function (t) {
4242
t.equal(argv.y, undefined);
4343
t.end();
4444
});
45+
46+
test('proto pollution (constructor function)', function (t) {
47+
var argv = parse(['--_.concat.constructor.prototype.y', '123']);
48+
function fnToBeTested() {}
49+
t.equal(fnToBeTested.y, undefined);
50+
t.equal(argv.y, undefined);
51+
t.end();
52+
});
53+
54+
// powered by snyk - https://github.com/backstage/backstage/issues/10343
55+
test('proto pollution (constructor function) snyk', function (t) {
56+
var argv = parse('--_.constructor.constructor.prototype.foo bar'.split(' '));
57+
t.equal((function(){}).foo, undefined);
58+
t.equal(argv.y, undefined);
59+
t.end();
60+
})

0 commit comments

Comments
 (0)
Please sign in to comment.