How do I stop this exception from being printed in the log file catalina.out
? It takes up a lot of room in the log file.
2018-10-12 02:25:20.394 ERROR 20077 --- [nio-8080-exec-7] o.s.boot.web.support.ErrorPageFilter : Forwarding to error page from request [/home] due to exception [The request was rejected because the URL contained a potentially malicious String ";"]
org.springframework.security.web.firewall.RequestRejectedException: The request was rejected because the URL contained a potentially malicious String ";"
at org.springframework.security.web.firewall.StrictHttpFirewall.rejectedBlacklistedUrls(StrictHttpFirewall.java:265) ~[spring-security-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.security.web.firewall.StrictHttpFirewall.getFirewalledRequest(StrictHttpFirewall.java:245) ~[spring-security-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
+50 more lines
I don't mind the single line ERROR but I'd rather not see the stack trace while scrolling through the log.
They are caused by testing requests like
172.31.43.154 - - [12/Oct/2018:07:52:42 +0000] "POST /dologin HTTP/1.1" 302 0 "-" "python-requests/2.18.4" "99.99.99.99"
172.31.43.154 - - [12/Oct/2018:07:52:42 +0000] "GET /home;jsessionid=4B9B7C8FFC2EA0B7A8E0C2E20E0B4D79 HTTP/1.1" 200 27 "-" "python-requests/2.18.4" "99.99.99.99"
I don't know if the tester is manually adding the cookie to the URL or being redirected to that path. It works in the browser and I already have
server.session.tracking-modes=cookie