Testing for HTTP Verb Tampering (OTG-INPVAL-003)

Brief Summary
The HTTP specification includes request methods other than the de-facto standard GET and POST requests. A standards compliant web server may respond to these alternative methods in ways not anticipated by developers.

Although the common description is 'verb' tampering, the HTTP 1.1 standard refers to these request types as different HTTP 'methods.'

Description of the Issue
The full HTTP 1.1 specification defines the following valid HTTP request methods, or verbs: OPTIONS GET HEAD POST PUT DELETE TRACE CONNECT

However, most web applications only need to respond to GET and POST requests - providing user data in the URL query string or appended to the request, respectively. The standard  style links trigger a GET request; form data submitted via   trigger POST requests. Forms defined without a method also send data via GET by default.

Oddly, the other valid HTTP methods are not supported by the HTML standard. Any HTTP method other than GET or POST needs to be calletd outside the HTML document. However, JavaScript and AJAX calls may send methods other than GET and POST.

As long as the web application being tested does not specifically call for any non-standard HTTP methods, testing for HTTP verb tampering is quite simple. If the server accepts a request other than GET or POST, the test fails. The solutions is to disable all non GET or POST functionality within the web application server, or in a web application firewall.

Black Box testing and example
Because the HTML standard does not support request methods other than GET or POST, we will need to craft our own HTTP requests to test the other methods. We highly recommend using a tool to do this, although we will demonstrate how to do