mirror of
https://github.com/github/codeql.git
synced 2025-12-18 01:33:15 +01:00
JavaScript: Improve XSS sanitizer detection.
We now use local data flow to detect more regexp-based sanitizers.
This commit is contained in:
@@ -34,7 +34,7 @@ module Shared {
|
||||
MetacharEscapeSanitizer() {
|
||||
getMethodName() = "replace" and
|
||||
exists(RegExpConstant c |
|
||||
c.getLiteral() = getArgument(0).asExpr() and
|
||||
c.getLiteral() = getArgument(0).getALocalSource().asExpr() and
|
||||
c.getValue().regexpMatch("['\"&<>]")
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user