File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
javascript/ql/lib/semmle/javascript/security/dataflow Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,17 @@ deprecated private class ConcreteMaybeFromProto extends MaybeFromProto {
24
24
ConcreteMaybeFromProto ( ) { this = this }
25
25
}
26
26
27
+ /** Gets a data flow node referring to an instance of `Map`. */
28
+ private DataFlow:: SourceNode mapObject ( DataFlow:: TypeTracker t ) {
29
+ t .start ( ) and
30
+ result = DataFlow:: globalVarRef ( "Map" ) .getAnInstantiation ( )
31
+ or
32
+ exists ( DataFlow:: TypeTracker t2 | result = mapObject ( t2 ) .track ( t2 , t ) )
33
+ }
34
+
35
+ /** Gets a data flow node referring to an instance of `Map`. */
36
+ private DataFlow:: SourceNode mapObject ( ) { result = mapObject ( DataFlow:: TypeTracker:: end ( ) ) }
37
+
27
38
/**
28
39
* A taint-tracking configuration for reasoning about unvalidated dynamic method calls.
29
40
*/
@@ -67,7 +78,9 @@ module UnvalidatedDynamicMethodCallConfig implements DataFlow::StateConfigSig {
67
78
not PropertyInjection:: hasUnsafeMethods ( read .getBase ( ) .getALocalSource ( ) )
68
79
)
69
80
or
70
- exists ( DataFlow:: SourceNode base , DataFlow:: CallNode get | get = base .getAMethodCall ( "get" ) |
81
+ exists ( DataFlow:: CallNode get |
82
+ get = mapObject ( ) .getAMethodCall ( "get" ) and
83
+ get .getNumArgument ( ) = 1 and
71
84
node1 = get .getArgument ( 0 ) and
72
85
node2 = get
73
86
) and
You can’t perform that action at this time.
0 commit comments