This site is the archived OWASP Foundation Wiki and is no longer accepting Account Requests.
To view the new OWASP Foundation website, please visit https://owasp.org
Testing for HTTP Verb Tampering (OTG-INPVAL-003)
This article is part of the new OWASP Testing Guide v4.
Back to the OWASP Testing Guide v4 ToC: https://www.owasp.org/index.php/OWASP_Testing_Guide_v4_Table_of_Contents Back to the OWASP Testing Guide Project: https://www.owasp.org/index.php/OWASP_Testing_Project
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 [1] 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 <a href=""></a>
style links trigger a GET request; form data submitted via <form method='POST'></form>
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 [2]. 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.
- Crafting custom HTTP requests
- OPTIONS
- GET
- HEAD
- POST
- PUT
- DELETE
- TRACE
- CONNECT
- Sending HTTP requests
- Parsing HTTP responses
Automated HTTP verb tampering testing
References
Whitepapers
...
Tools
...