diff --git a/auth_mellon_util.c b/auth_mellon_util.c index 2f8c9c3..6a686db 100644 --- a/auth_mellon_util.c +++ b/auth_mellon_util.c @@ -927,6 +927,10 @@ int am_check_url(request_rec *r, const char *url) { const char *i; + if (url == NULL) { + return HTTP_BAD_REQUEST; + } + for (i = url; *i; i++) { if (*i >= 0 && *i < ' ') { /* Deny all control-characters. */ @@ -943,6 +947,12 @@ int am_check_url(request_rec *r, const char *url) } } + if (strstr(url, "///") == url) { + AM_LOG_RERROR(APLOG_MARK, APLOG_ERR, HTTP_BAD_REQUEST, r, + "URL starts with '///'"); + return HTTP_BAD_REQUEST; + } + return OK; }