mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
use HtmlSanitizerCall to recognize sanitizers
This commit is contained in:
@@ -304,12 +304,10 @@ module DomBasedXss {
|
||||
private class UriEncodingSanitizer extends Sanitizer, Shared::UriEncodingSanitizer { }
|
||||
|
||||
/**
|
||||
* Holds if there exists two dataflow edges to `succ`, where one edges is sanitized, and the other edge starts with `pred`.
|
||||
* Holds if there exists two dataflow edges to `succ`, where one edges is sanitized, and the other edge starts with `pred`.
|
||||
*/
|
||||
predicate isOptionallySanitizedEdge(DataFlow::Node pred, DataFlow::Node succ) {
|
||||
exists(DataFlow::CallNode sanitizer |
|
||||
sanitizer.getCalleeName().regexpMatch("(?i).*sanitize.*")
|
||||
|
|
||||
exists(HtmlSanitizerCall sanitizer |
|
||||
// sanitized = sanitize ? sanitizer(source) : source;
|
||||
exists(ConditionalExpr branch, Variable var, VarAccess access |
|
||||
branch = succ.asExpr() and access = var.getAnAccess()
|
||||
|
||||
Reference in New Issue
Block a user