-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ecfafc5
commit 0c2a1bd
Showing
4 changed files
with
30 additions
and
29 deletions.
There are no files selected for viewing
17 changes: 9 additions & 8 deletions
17
java/ql/test/query-tests/security/CWE-079/semmle/tests/XSS.ql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 7 additions & 7 deletions
14
java/ql/test/query-tests/security/CWE-089/semmle/examples/taintedString.ql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import semmle.code.java.dataflow.FlowSources | ||
|
||
class Conf extends TaintTracking::Configuration { | ||
Conf() { this = "qltest:cwe-089:taintedString" } | ||
module Config implements DataFlow::ConfigSig { | ||
predicate isSource(DataFlow::Node source) { source instanceof UserInput } | ||
|
||
override predicate isSource(DataFlow::Node source) { source instanceof UserInput } | ||
|
||
override predicate isSink(DataFlow::Node sink) { any() } | ||
predicate isSink(DataFlow::Node sink) { any() } | ||
} | ||
|
||
from Conf conf, Expr tainted, Method method | ||
module Flow = TaintTracking::Global<Config>; | ||
|
||
from Expr tainted, Method method | ||
where | ||
conf.hasFlowToExpr(tainted) and | ||
Flow::flowToExpr(tainted) and | ||
tainted.getEnclosingCallable() = method and | ||
tainted.getFile().getStem() = ["Test", "Validation"] | ||
select method, tainted.getLocation().getStartLine() - method.getLocation().getStartLine(), tainted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters