Skip to content

Commit b728f71

Browse files
committed
JS: Move 'this' sanitizer to customizations
1 parent 62dca44 commit b728f71

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

javascript/ql/lib/semmle/javascript/security/dataflow/UnsafeJQueryPluginCustomizations.qll

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ module UnsafeJQueryPlugin {
3131
*/
3232
abstract class Sanitizer extends DataFlow::Node { }
3333

34+
/**
35+
* The receiver of a function, seen as a sanitizer.
36+
*
37+
* Plugins often do `$(this)` to coerce an existing DOM element to a jQuery object.
38+
*/
39+
private class ThisSanitizer extends Sanitizer instanceof DataFlow::ThisNode { }
40+
3441
/**
3542
* An argument that may act as an HTML fragment rather than a CSS selector, as a sink for remote unsafe jQuery plugins.
3643
*/

javascript/ql/lib/semmle/javascript/security/dataflow/UnsafeJQueryPluginQuery.qll

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ class Configuration extends TaintTracking::Configuration {
2323
node instanceof DomBasedXss::Sanitizer
2424
or
2525
node instanceof Sanitizer
26-
or
27-
// Plugins usually do `$(this)` to coerce an existing DOM element to a jQuery object.
28-
node instanceof DataFlow::ThisNode
2926
}
3027

3128
override predicate isAdditionalTaintStep(DataFlow::Node src, DataFlow::Node sink) {

0 commit comments

Comments
 (0)