File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
javascript/ql/src/semmle/javascript/frameworks Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -188,4 +188,20 @@ module Babel {
188
188
/** Gets the name of the variable used to create JSX elements. */
189
189
string getJsxFactoryVariableName ( ) { result = getOption ( "pragma" ) .( JSONString ) .getValue ( ) }
190
190
}
191
+
192
+ /**
193
+ * A taint step through a call to the Babel `transform` function.
194
+ */
195
+ private class TransformTaintStep extends TaintTracking:: SharedTaintStep {
196
+ override predicate step ( DataFlow:: Node pred , DataFlow:: Node succ ) {
197
+ exists ( DataFlow:: CallNode call |
198
+ call =
199
+ API:: moduleImport ( [ "@babel/standalone" , "@babel/core" ] )
200
+ .getMember ( [ "transform" , "transformSync" ] )
201
+ .getACall ( ) and
202
+ pred = call .getArgument ( 0 ) and
203
+ succ = call
204
+ )
205
+ }
206
+ }
191
207
}
You can’t perform that action at this time.
0 commit comments