File tree Expand file tree Collapse file tree 2 files changed +3
-21
lines changed
javascript/ql/lib/semmle/javascript Expand file tree Collapse file tree 2 files changed +3
-21
lines changed Original file line number Diff line number Diff line change @@ -563,25 +563,6 @@ module JQuery {
563
563
}
564
564
}
565
565
566
- /** Gets a data flow node that reaches a sink that is interpreted as HTML. */
567
- private DataFlow:: SourceNode htmlCallback ( DataFlow:: TypeBackTracker t ) {
568
- t .start ( ) and
569
- any ( JQuery:: MethodCall c ) .interpretsArgumentAsHtml ( result .getALocalUse ( ) )
570
- or
571
- exists ( DataFlow:: TypeBackTracker t2 | result = htmlCallback ( t2 ) .backtrack ( t2 , t ) )
572
- }
573
-
574
- /**
575
- * Gets a function that is passed as a callback to a jQuery function, which will interpret its return value as HTML.
576
- *
577
- * For example, this gets the function `f` below:
578
- * ```js
579
- * function f() { ... }
580
- * $('#foo').replaceWith(f);
581
- * ```
582
- */
583
- DataFlow:: FunctionNode htmlCallback ( ) { result = htmlCallback ( DataFlow:: TypeBackTracker:: end ( ) ) }
584
-
585
566
/**
586
567
* Holds for jQuery plugin definitions of the form `$.fn.<pluginName> = <plugin>` or `$.extend($.fn, {<pluginName>, <plugin>})`.
587
568
*/
Original file line number Diff line number Diff line change @@ -123,8 +123,9 @@ class Configuration extends TaintTracking::Configuration {
123
123
inlbl = TaintedUrlSuffix:: label ( ) and
124
124
outlbl = prefixLabel ( )
125
125
or
126
- exists ( DataFlow:: FunctionNode callback |
127
- callback = JQuery:: htmlCallback ( ) and
126
+ exists ( DataFlow:: FunctionNode callback , DataFlow:: Node arg |
127
+ any ( JQuery:: MethodCall c ) .interpretsArgumentAsHtml ( arg ) and
128
+ callback = arg .getABoundFunctionValue ( _) and
128
129
src = callback .getReturnNode ( ) and
129
130
trg = callback and
130
131
inlbl = outlbl
You can’t perform that action at this time.
0 commit comments