Skip to content

Commit 978ef15

Browse files
committed
Update method names
1 parent a2c98ba commit 978ef15

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

java/ql/src/experimental/Security/CWE/CWE-552/UnsafeUrlForward.qll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ private class ExactStringPathMatchGuard extends UnsafeUrlForwardBarrierGuard ins
8181
*/
8282
private class AllowListCheckGuard extends UnsafeUrlForwardBarrierGuard instanceof MethodAccess {
8383
AllowListCheckGuard() {
84-
(isStringPathMatch(this) or isFilePathMatch(this)) and
84+
(isStringPartialMatch(this) or isPathPartialMatch(this)) and
8585
not isDisallowedWord(this.getAnArgument())
8686
}
8787

@@ -111,7 +111,7 @@ private class AllowListCheckGuard extends UnsafeUrlForwardBarrierGuard instanceo
111111
*/
112112
private class BlockListCheckGuard extends UnsafeUrlForwardBarrierGuard instanceof MethodAccess {
113113
BlockListCheckGuard() {
114-
(isStringPathMatch(this) or isFilePathMatch(this)) and
114+
(isStringPartialMatch(this) or isPathPartialMatch(this)) and
115115
isDisallowedWord(this.getAnArgument())
116116
}
117117

@@ -137,18 +137,18 @@ private class BlockListCheckGuard extends UnsafeUrlForwardBarrierGuard instanceo
137137
}
138138

139139
/**
140-
* Holds if `ma` is a call to a method that checks a path string.
140+
* Holds if `ma` is a call to a method that checks a partial string match.
141141
*/
142-
private predicate isStringPathMatch(MethodAccess ma) {
142+
private predicate isStringPartialMatch(MethodAccess ma) {
143143
ma.getMethod().getDeclaringType() instanceof TypeString and
144144
ma.getMethod().getName() =
145145
["contains", "startsWith", "matches", "regionMatches", "indexOf", "lastIndexOf"]
146146
}
147147

148148
/**
149-
* Holds if `ma` is a call to a method of `java.nio.file.Path` that checks a path.
149+
* Holds if `ma` is a call to a method of `java.nio.file.Path` that checks a partial path match.
150150
*/
151-
private predicate isFilePathMatch(MethodAccess ma) {
151+
private predicate isPathPartialMatch(MethodAccess ma) {
152152
ma.getMethod().getDeclaringType() instanceof TypePath and
153153
ma.getMethod().getName() = "startsWith"
154154
}

0 commit comments

Comments
 (0)