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 custom HTTP requests to test the other methods. We highly recommend using a tool to do this, although we will demonstrate how to do manually as well.

Manual HTTP verb tampering testing
This example is written using the netcat package from openbsd (standard with most Linux distributions). You may also use telnet (included with Windows) in a similar fashion.


 * 1) Crafting custom HTTP requests
 * 2) OPTIONS
 * 3) GET
 * 4) HEAD
 * 5) POST
 * 6) PUT
 * 7) DELETE
 * 8) TRACE
 * 9) CONNECT
 * 10) Sending HTTP requests
 * 11) Parsing HTTP responses