File tree Expand file tree Collapse file tree
javascript/ql/src/semmle/javascript/frameworks Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -181,6 +181,33 @@ module Templating {
181181 }
182182 }
183183
184+ /**
185+ * A data flow step from the expression in a placeholder tag to the tag itself,
186+ * representing the value plugged into the template.
187+ */
188+ private class TemplatePlaceholderStep extends DataFlow:: SharedFlowStep {
189+ override predicate step ( DataFlow:: Node pred , DataFlow:: Node succ ) {
190+ exists ( TemplatePlaceholderTag tag |
191+ pred = tag .getInnerTopLevel ( ) .getExpression ( ) .flow ( ) and
192+ succ = tag .asDataFlowNode ( )
193+ )
194+ }
195+ }
196+
197+ /**
198+ * A taint step from a `TemplatePlaceholderTag` to the corresponding `GeneratedCodeExpr`,
199+ * representing that control over the generated code gives control over the expression
200+ * return value.
201+ */
202+ private class PlaceholderToGeneratedCodeStep extends TaintTracking:: SharedTaintStep {
203+ override predicate step ( DataFlow:: Node pred , DataFlow:: Node succ ) {
204+ exists ( GeneratedCodeExpr expr |
205+ pred = expr .getPlaceholderTag ( ) .asDataFlowNode ( ) and
206+ succ = expr .flow ( )
207+ )
208+ }
209+ }
210+
184211 /** A file that can be referenced by a template instantiation. */
185212 abstract class TemplateFile extends File {
186213 /** Gets a placeholder tag in this file. */
You can’t perform that action at this time.
0 commit comments