Check: TCAT-AS-000090
Apache Tomcat Application Server 9 STIG:
TCAT-AS-000090
(in versions v2 r7 through v2 r2)
Title
DefaultServlet must be set to readonly for PUT and DELETE. (Cat II impact)
Discussion
The DefaultServlet is a servlet provided with Tomcat. It is called when no other suitable page can be displayed to the client. The DefaultServlet serves static resources as well as directory listings and is declared globally in $CATALINA_BASE/conf/web.xml. By default, Tomcat behaves as if the DefaultServlet is set to "true" (HTTP commands like PUT and DELETE are rejected). However, the readonly parameter is not in the web.xml file by default so to ensure proper configuration and system operation, the "readonly" parameter in web.xml must be created and set to "true". Creating the setting in web.xml provides assurances the system is operating as required. Changing the readonly parameter to false could allow clients to delete or modify static resources on the server and upload new resources.
Check Content
From the Tomcat server run the following command: sudo cat $CATALINA_BASE/conf/web.xml |grep -i -A5 -B2 defaultservlet If the "readonly" param-value for the "DefaultServlet" servlet class = "false" or does not exist, this is a finding.
Fix Text
From the Tomcat server console as a privileged user: Edit the $CATALINA_BASE/conf/web.xml file. If the "readonly" param-value does not exist, it must be created. Ensure the "readonly" param-value for the "DefaultServlet" servlet class = "true".
Additional Identifiers
Rule ID: SV-222934r879530_rule
Vulnerability ID: V-222934
Group Title: SRG-APP-000033-AS-000024
Expert Comments
CCIs
Number | Definition |
---|---|
CCI-000213 |
The information system enforces approved authorizations for logical access to information and system resources in accordance with applicable access control policies. |
Controls
Number | Title |
---|---|
AC-3 |
Access Enforcement |