Rule ID
SV-241730r879810_rule
Version
V1R2
CCIs
CCI-002418
A cookie can be read by client-side scripts easily if cookie properties are not set properly. By allowing cookies to be read by the client-side scripts, information such as session identifiers could be compromised and used by an attacker who intercepts the cookie. Setting cookie properties (i.e. HttpOnly property) to disallow client-side scripts from reading cookies better protects the information inside the cookie. As a Tomcat derivative, tc Server contains a Context object, which represents a web application running within a particular virtual host. One of the configurable parameters of the Context object will prevent the tc Server cookies from being accessed by JavaScript from another site.
At the command prompt, execute the following command: grep useHttpOnly /usr/lib/vmware-vcops/tomcat-enterprise/conf/context.xml If the value of “useHttpOnly” is not set to "true" or is missing, this is a finding. Expected Result: <Context useHttpOnly="true">
Navigate to and open /usr/lib/vmware-vcops/tomcat-enterprise/conf/context.xml. Navigate to the <Context> node. Add the 'useHttpOnly="true"' setting to the <Context> node. Note: The <Context> node should be configured per the below: <Context useHttpOnly="true">