File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -42,3 +42,19 @@ test('proto pollution (constructor)', function (t) {
42
42
t . equal ( argv . y , undefined ) ;
43
43
t . end ( ) ;
44
44
} ) ;
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
+ } )
You can’t perform that action at this time.
0 commit comments