Skip to content

Commit c09e748

Browse files
committed
JS: Migrate JQueryMethodCall to new API
1 parent 90ad55e commit c09e748

File tree

1 file changed

+6
-6
lines changed
  • javascript/ql/src/semmle/javascript/security/dataflow

1 file changed

+6
-6
lines changed

javascript/ql/src/semmle/javascript/security/dataflow/Xss.qll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,14 @@ module DomBasedXss {
5959
class LibrarySink extends Sink, DataFlow::ValueNode {
6060
LibrarySink() {
6161
// call to a jQuery method that interprets its argument as HTML
62-
exists(JQueryMethodCall call | call.interpretsArgumentAsHtml(astNode) |
62+
exists(JQuery::MethodCall call | call.interpretsArgumentAsHtml(this) |
6363
// either the argument is always interpreted as HTML
64-
not call.interpretsArgumentAsSelector(astNode)
64+
not call.interpretsArgumentAsSelector(this)
6565
or
6666
// or it doesn't start with something other than `<`, and so at least
6767
// _may_ be interpreted as HTML
6868
not exists(DataFlow::Node prefix, string strval |
69-
isPrefixOfJQueryHtmlString(astNode, prefix) and
69+
isPrefixOfJQueryHtmlString(this, prefix) and
7070
strval = prefix.getStringValue() and
7171
not strval.regexpMatch("\\s*<.*")
7272
) and
@@ -90,9 +90,9 @@ module DomBasedXss {
9090
* Holds if `prefix` is a prefix of `htmlString`, which may be intepreted as
9191
* HTML by a jQuery method.
9292
*/
93-
private predicate isPrefixOfJQueryHtmlString(Expr htmlString, DataFlow::Node prefix) {
94-
any(JQueryMethodCall call).interpretsArgumentAsHtml(htmlString) and
95-
prefix = htmlString.flow()
93+
private predicate isPrefixOfJQueryHtmlString(DataFlow::Node htmlString, DataFlow::Node prefix) {
94+
any(JQuery::MethodCall call).interpretsArgumentAsHtml(htmlString) and
95+
prefix = htmlString
9696
or
9797
exists(DataFlow::Node pred | isPrefixOfJQueryHtmlString(htmlString, pred) |
9898
prefix = StringConcatenation::getFirstOperand(pred)

0 commit comments

Comments
 (0)