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 { }
63
63
64
64
private class PrimitiveSanitizer extends RequestForgerySanitizer instanceof SimpleTypeSanitizer { }
65
65
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
+ */
66
73
class HostnameSanitizingPrefix extends InterestingPrefix {
67
74
int offset ;
68
75
69
76
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 "/".
74
77
exists ( this .getStringValue ( ) .regexpFind ( "([?#]|[^?#:/\\\\][/\\\\])|^/$" , 0 , offset ) )
75
78
}
76
79
You can’t perform that action at this time.
0 commit comments