8000 remove sanitiserGuards · github/codeql@a88c368 · GitHub
[go: up one dir, main page]

Skip to content

Commit a88c368

Browse files
author
Porcuiney Hairs
committed
remove sanitiserGuards
1 parent 84c9137 commit a88c368

File tree

1 file changed

+0
-29
lines changed

java/ql/src/experimental/Security/CWE/CWE-117/LogInjection.ql

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -30,35 +30,6 @@ private class LogInjectionConfiguration extends TaintTracking::Configuration {
3030
override predicate isSanitizer(DataFlow::Node node) {
3131
node.getType() instanceof BoxedType or node.getType() instanceof PrimitiveType
3232
}
33-
34-
override predicate isSanitizerGuard(DataFlow::BarrierGuard guard) {
35-
guard instanceof StrCheckSanitizerGuard
36-
}
37-
}
38-
39-
/**
40-
* Models any regex or equality check as a sanitizer guard.
41-
* Assumes any check on the taint to be a valid sanitizing check.
42-
*/
43-
private class StrCheckSanitizerGuard extends DataFlow::BarrierGuard {
44-
StrCheckSanitizerGuard() {
45-
exists(Method m |
46-
m.getDeclaringType().hasQualifiedName("java.util.regex", "Pattern") and
47-
m.hasName("matches")
48-
or
49-
m.getDeclaringType() instanceof TypeString and
50-
m.hasName([
51-
"startsWith", "regionMatches", "matches", "equals", "equalsIgnoreCase", "endsWith",
52-
"contentEquals", "contains"
53-
])
54-
|
55-
m.getAReference() = this
56-
)
57-
}
58-
59-
override predicate checks(Expr e, boolean branch) {
60-
e = this.(MethodAccess).getQualifier() and branch = true
61-
}
6233
}
6334

6435
from LogInjectionConfiguration cfg, DataFlow::PathNode source, DataFlow::PathNode sink

0 commit comments

Comments
 (0)
0