File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
java/ql/lib/semmle/code/java/security Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -63,14 +63,17 @@ abstract class RequestForgerySanitizer extends DataFlow::Node { }
6363
6464private class PrimitiveSanitizer extends RequestForgerySanitizer instanceof SimpleTypeSanitizer { }
6565
66+ /**
67+ * A string constant that contains a prefix which looks like when it is prepended to untrusted
68+ * input, it will restrict the host or entity addressed.
69+ *
70+ * For example, anything containing `?` or `#`, or a slash that doesn't appear to be a protocol
71+ * specifier (e.g. `http://` is not sanitizing), or specifically the string "/".
72+ */
6673class HostnameSanitizingPrefix extends InterestingPrefix {
6774 int offset ;
6875
6976 HostnameSanitizingPrefix ( ) {
70- // Matches strings that look like when prepended to untrusted input, they will restrict
71- // the host or entity addressed: for example, anything containing `?` or `#`, or a slash that
72- // doesn't appear to be a protocol specifier (e.g. `http://` is not sanitizing), or specifically
73- // the string "/".
7477 exists ( this .getStringValue ( ) .regexpFind ( "([?#]|[^?#:/\\\\][/\\\\])|^/$" , 0 , offset ) )
7578 }
7679
You can’t perform that action at this time.
0 commit comments