mirror of
https://github.com/github/codeql.git
synced 2026-04-24 16:25:15 +02:00
JS: Update ReflectedXssWithCustomSanitizer test
This commit is contained in:
@@ -3,18 +3,17 @@
|
||||
//
|
||||
import javascript
|
||||
import semmle.javascript.security.dataflow.ReflectedXssQuery
|
||||
private import semmle.javascript.security.dataflow.Xss::Shared as SharedXss
|
||||
|
||||
class IsVarNameSanitizer extends TaintTracking::AdditionalSanitizerGuardNode, DataFlow::CallNode {
|
||||
class IsVarNameSanitizer extends SharedXss::BarrierGuard, DataFlow::CallNode {
|
||||
IsVarNameSanitizer() { this.getCalleeName() = "isVarName" }
|
||||
|
||||
override predicate sanitizes(boolean outcome, Expr e) {
|
||||
override predicate blocksExpr(boolean outcome, Expr e) {
|
||||
outcome = true and
|
||||
e = this.getArgument(0).asExpr()
|
||||
}
|
||||
|
||||
override predicate appliesTo(TaintTracking::Configuration cfg) { cfg instanceof Configuration }
|
||||
}
|
||||
|
||||
from Configuration xss, Source source, Sink sink
|
||||
where xss.hasFlow(source, sink)
|
||||
from Source source, Sink sink
|
||||
where ReflectedXssFlow::flow(source, sink)
|
||||
select sink, "Cross-site scripting vulnerability due to $@.", source, "user-provided value"
|
||||
|
||||
Reference in New Issue
Block a user