We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a665d5d commit b25e867Copy full SHA for b25e867
java/ql/src/semmle/code/java/security/RequestForgery.qll
@@ -222,6 +222,10 @@ private class HostnameSanitizingPrefix extends CompileTimeConstantExpr {
222
int offset;
223
224
HostnameSanitizingPrefix() {
225
+ // Matches strings that look like when prepended to untrusted input, they will restrict
226
+ // the host or entity addressed: for example, anything containing `?` or `#`, or a slash that
227
+ // doesn't appear to be a protocol specifier (e.g. `http://` is not sanitizing), or specifically
228
+ // the string "/".
229
exists(
230
this.getStringValue()
231
.regexpFind(".*([?#]|[^?#:/\\\\][/\\\\]).*|[/\\\\][^/\\\\].*|^/$", 0, offset)
0 commit comments