Skip to content

Commit 87ec31a

Browse files
committed
JS: Update ReflectedXssWithCustomSanitizer test
1 parent ca3f481 commit 87ec31a

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/ReflectedXssWithCustomSanitizer.ql

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,17 @@
33
//
44
import javascript
55
import semmle.javascript.security.dataflow.ReflectedXssQuery
6+
private import semmle.javascript.security.dataflow.Xss::Shared as SharedXss
67

7-
class IsVarNameSanitizer extends TaintTracking::AdditionalSanitizerGuardNode, DataFlow::CallNode {
8+
class IsVarNameSanitizer extends SharedXss::BarrierGuard, DataFlow::CallNode {
89
IsVarNameSanitizer() { this.getCalleeName() = "isVarName" }
910

10-
override predicate sanitizes(boolean outcome, Expr e) {
11+
override predicate blocksExpr(boolean outcome, Expr e) {
1112
outcome = true and
1213
e = this.getArgument(0).asExpr()
1314
}
14-
15-
override predicate appliesTo(TaintTracking::Configuration cfg) { cfg instanceof Configuration }
1615
}
1716

18-
from Configuration xss, Source source, Sink sink
19-
where xss.hasFlow(source, sink)
17+
from Source source, Sink sink
18+
where ReflectedXssFlow::flow(source, sink)
2019
select sink, "Cross-site scripting vulnerability due to $@.", source, "user-provided value"

0 commit comments

Comments
 (0)