Skip to content

Commit 43966eb

Browse files
committed
Change regex used in HostnameSanitizingPrefix
1 parent 774baea commit 43966eb

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

java/ql/lib/semmle/code/java/security/RequestForgery.qll

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,7 @@ private class HostnameSanitizingPrefix extends InterestingPrefix {
7979
// the host or entity addressed: for example, anything containing `?` or `#`, or a slash that
8080
// doesn't appear to be a protocol specifier (e.g. `http://` is not sanitizing), or specifically
8181
// the string "/".
82-
exists(
83-
this.getStringValue()
84-
.regexpFind(".*([?#]|[^?#:/\\\\][/\\\\]).*|[/\\\\][^/\\\\].*|^/$", 0, offset)
85-
)
82+
exists(this.getStringValue().regexpFind("([?#]|[^?#:/\\\\][/\\\\])|^/$", 0, offset))
8683
}
8784

8885
override int getOffset() { result = offset }

0 commit comments

Comments
 (0)