There is a serious security issue in our product which runs on apache tomcat server listening on ports 80 and 443. The routing of incoming HTTP/HTTPS packets on these ports is configured by our product classes, which fails to ensure that each requested URL refers to a file that is both located within the web root of the server and is of a type that is allowed to be served.
In particular, packets that match '/error/*' in the url are configured to use the 'docroot' folder as the document root for serving files. And so paths which traverse out of the /error/ (i.e docroot) directory using URL encoded backslashes %5C
can also be accessed and downloaded. For example a remote user can give an url like –
https://MyDomain/error/..%5c..%5csettings.properties
to access the remote file settings.properties that is on the same level as docroot. We are trying to overcome this through firewall rules and network segmentation. But is there a setting in tomcat that can be used to prevent remote users from accessing files outside the project root folder. That would be very useful.