File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
javascript/ql/src/semmle/javascript/security/dataflow Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -28,14 +28,15 @@ module Shared {
28
28
abstract class SanitizerGuard extends TaintTracking:: SanitizerGuardNode { }
29
29
30
30
/**
31
- * A regexp replacement involving an HTML meta-character, viewed as a sanitizer for
31
+ * A global regexp replacement involving an HTML meta-character, viewed as a sanitizer for
32
32
* XSS vulnerabilities.
33
33
*
34
34
* The XSS queries do not attempt to reason about correctness or completeness of sanitizers,
35
35
* so any such replacement stops taint propagation.
36
36
*/
37
37
class MetacharEscapeSanitizer extends Sanitizer , StringReplaceCall {
38
38
MetacharEscapeSanitizer ( ) {
39
+ this .isGlobal ( ) and
39
40
exists ( RegExpConstant c |
40
41
c .getLiteral ( ) = getRegExp ( ) .asExpr ( ) and
41
42
c .getValue ( ) .regexpMatch ( "['\"&<>]" )
You can’t perform that action at this time.
0 commit comments