- How to reproduce the same?
There are multiple answers on this site for exactly that question. Typing HTTP method
into the Search box pulls up:
- How to fix this problem issue?
Under Tomcat, you can disable specific methods via the web.xml configuration file:
<security-constraint>
<web-resource-collection>
<web-resource-name><strong>restricted methods</strong></web-resource-name>
<url-pattern>/*</url-pattern>
<http-method>PUT</http-method>
<http-method>POST</http-method>
<http-method>DELETE</http-method>
<http-method>OPTIONS</http-method>
<http-method>TRACE</http-method>
</web-resource-collection>
<auth-constraint />
</security-constraint>
As @Danny points out in the comments, you may want a whitelist rather than a blacklist, and here's a Tomcat 7 example. Here's an alternative for Tomcat 6.
That being said, a blacklist is often sufficient for HTTP methods because:
- There's a reasonably static/unchanging list of what's supported,
- Unsupported methods are generally quietly dropped by any competent web server
That said, if the report of Tomcat being case sensitive is true, a whitelist would be the appropriate way to compensate for crappy software.