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 {
563563 }
564564 }
565565
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-
585566 /**
586567 * Holds for jQuery plugin definitions of the form `$.fn.<pluginName> = <plugin>` or `$.extend($.fn, {<pluginName>, <plugin>})`.
587568 */
Original file line number Diff line number Diff line change @@ -123,8 +123,9 @@ class Configuration extends TaintTracking::Configuration {
123123 inlbl = TaintedUrlSuffix:: label ( ) and
124124 outlbl = prefixLabel ( )
125125 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
128129 src = callback .getReturnNode ( ) and
129130 trg = callback and
130131 inlbl = outlbl
You can’t perform that action at this time.
0 commit comments