-
Notifications
You must be signed in to change notification settings - Fork 41.7k
Description
During a penetration test one finding was the information disclosure of using a Tomcat webserver.
If a request with an invalid URL (e.g. http://localhost:8080/[test ) is executed the configured custom error pages are not used.
Instead the embedded Tomcats ErrorReportValve is used and presents a default Tomcat Error page.
It is possible to configure it to some extends using
server.error.whitelabel.enabled=falseserver.error.include-stacktrace=never
But the default HTTP Status 400 page is always returned.
It is possible to create a custom ErrorReportValve and set the properties like errorCode.400 to create a custom page, but this configuration is not possible with an application.properties file.
(At least as far as I can see)
See an example project at https://github.com/patst/tomcat-errorvalve
Maybe it would be a good idea to expose the properties for configuration.
The ErrorReportValve is created at
Line 295 in 7671561
| private void customizeErrorReportValve(ErrorProperties error, ConfigurableTomcatWebServerFactory factory) { |
What do you think?