A Cross Site Scripting (XSS) vulnerabilty has been identified in Struts by Hacktics.com. For further information, see...
The following GA quality versions of Struts are vulnerable:
N.B. i.e. Struts 1.2.8 and Struts 1.3.x do NOT have this vulnerability.
There are three possible courses of action users can take to guard against this vulnerability:
From Struts 1.1 onwards it is possible to configure one action in the struts-config.xml for mappings which are Not Found. This action should be configure to forward to a custom error page (which doesn't include the Request's path!).
To do this you specify the unknown attribute on ONE of your action mappings and forward to a custom error page, for example...
<struts-config> <action-mappings> <action forward="/CustomNotFoundError.jsp" unknown="true" /> </action-mappings> </struts-config>
Ralph Hauser reports that the above "doesn't validate with the 1.2 DTD". I tried it in the struts-examples webapp for Struts 1.2.7 and it worked fine for me - niallp. However, if the above doesn't work, then add a "path" element to the action mapping:
<struts-config> <action-mappings> <action path="/unknown" forward="/CustomNotFoundError.jsp" unknown="true" /> </action-mappings> </struts-config>
Struts has been modified to remove this vulnerability in Struts 1.2.8. For further information on Struts 1.2.8, see:
Check your servlet container's documentation to see if you can configure a custom error page for 404 / Not Found status.