# Method Override CSRF
> Exploiting servers that let the HTTP method seen by the router or handler differ from the wire method (GET-reachable mutations, `_method`/`X-HTTP-Method-Override`, HEAD-as-GET, `$_REQUEST` merging), which simultaneously defeats `SameSite=Lax` and method-conditioned CSRF checks.
## How it works
Two controls key on the method, and both break if the handler doesn't:
1. **`SameSite=Lax`** sends cookies on cross-site *top-level safe-method* navigations. If a mutation runs on GET, Lax is moot.
2. **CSRF middleware** often validates only `POST` (or only non-safe methods) — `if ($_SERVER['REQUEST_METHOD'] !== 'POST') return true;` — or runs on the wire method while routing uses an override.
Override mechanisms: `_method` in query or body (Symfony, Laravel, Rails, Express method-override), `X-HTTP-Method`, `X-HTTP-Method-Override` headers (headers need same-origin JS; params work from a plain link/form), framework routers that send `HEAD` to the `GET` handler, and PHP `$_REQUEST` merging GET/POST/cookie input so a POST handler reads query params.
## Techniques / payloads
Lax bypass: wire method GET (cookie attached on top-level nav), effective method POST:
```
GET /my-account/change-email?email=x%40evil.tld&_method=POST
```
```html
<form action="https://target/account/transfer" method="GET">
<input type="hidden" name="_method" value="POST">
<input type="hidden" name="recipient" value="x"><input type="hidden" name="amount" value="1">
</form>
```
Test order:
1. Replay the POST as GET with params in the query; then `HEAD`.
2. If `405`, add `_method=POST` (query), then in body for a `POST` → `PUT/PATCH/DELETE` downgrade (avoids preflight).
3. Check whether the token check is skipped on the GET/HEAD variant even if the method is accepted.
4. Look for other GET-reachable body channels (e.g. Apache Juneau's `content` query param, CVE-2026-73099).
5. GraphQL: send the mutation as `GET ?query=`.
6. Deliver via top-level navigation (link, `location=`, `window.open`) — not `<img>`/iframe, which Lax strips.
Delivery to privileged users: admin bots or support staff that open links in tickets turn a GET CSRF into admin-context execution (bblabs lab of a $200 HackerOne report: password change accepting GET + ticket-reviewing admin bot).
## Notable cases
- **PortSwigger lab "SameSite Lax bypass via method override"** — `405` on GET, `_method=POST` accepted; email change. [[raw/portswigger.net/lab-samesite-lax-bypass-via-method-override-portswigger-2871|Lab: SameSite Lax Bypass via Method Override - PortSwigger]], [[raw/medium.com/web-security-academy-csrf-samesite-lax-bypass-via-method-override-4656|Web Security Academy: CSRF SameSite Lax Bypass via Method Override]], [[raw/logicbreaker.sh/samesite-lax-bypass-via-method-override-14234|SameSite Lax bypass via method override]], [[raw/k0z1l.github.io/portswigger-csrf-lab-samesite-lax-bypass-via-method-override-15858|k0z1l writeup]] (frames it as a browser/middleware divergence: Lax keys on the outward verb of a top-level navigation, the middleware on `_method`)
- **vtenext < 25.02.2 (CVE-2025-71454)** — CSRF protection bypass via HTTP method tampering (CVSS 6.9). [[raw/vulncheck.com/vtenext-csrf-protection-bypass-via-http-method-tampering-13426|vtenext CSRF protection bypass via HTTP method tampering]]
- **FlowIntel < 4.1.0 (GHSA-mrjg-wcmv-396q)** — 14 destructive routes (case delete/merge, template edits) accept GET, bypassing Flask-WTF token validation. [[raw/github.com/flowintel-csrf-15520|FlowIntel CSRF]]
- **Thelia** — 39 of 40 delete routes and all toggle routes accept GET; token sits in the URL. [[raw/github.com/thelia-back-office-csrf-token-leak-get-deletes-13244|Thelia back-office CSRF token leak + GET deletes]]
- **Omnispace Agora (CVE-2026-63150)** — merges `$_GET`/`$_POST`; forged GET creates admin accounts. [[raw/github.com/omnispace-agora-project-csrf-14679|Omnispace Agora Project CSRF]]
- **visualTicket** — state changes exposed via GET without protection; partial fix moved to POST + tokens + `SameSite=Lax`. [[raw/github.com/visualticket-csrf-across-multiple-endpoints-14931|visualTicket CSRF across multiple endpoints]]
- **OpenAI Discord verification (P3, Bugcrowd)** — state-changing `GET /unlink` on `discord.verify.openai.com`. [[raw/pickleoffsec.com/one-link-to-unlink-csrf-in-openai-discord-verification-service-12650|One Link to Unlink: CSRF in OpenAI Discord Verification Service]]
- **Webmin 2.670** — referer-exempt GET `index.cgi` 302s into a firewall setter. [[raw/abraxaslabs.tech/webmin-2-670-firewalld-index-cgi-csrf-sets-zone-to-trusted-14677|Webmin 2.670 firewalld index.cgi CSRF sets zone to trusted]]
- **OpenMage** — OAuth confirm actions skip form-key validation on GET. [[raw/github.com/openmage-magento-lts-cross-site-request-forgery-critical-14534|OpenMage Magento LTS cross-site request forgery (critical)]]
## Defenses
- No side effects on safe methods — enforce at the router (explicit `methods=["POST"]`) and audit every GET/HEAD handler.
- Disable method override, or allow it only on `POST` bodies and run CSRF validation on the **effective** method.
- CSRF middleware: validate every non-safe *effective* method; never early-return on method.
- Read inputs from the expected source only (no `$_REQUEST`).
## Related
- [[Cross-Site Request Forgery]]
- [[SameSite Cookies]]
- [[CSRF Token Bypasses]]
- [[JSON CSRF]]
- [[CSRF Prevention]]
## Sources
- [[raw/portswigger.net/lab-samesite-lax-bypass-via-method-override-portswigger-2871|Lab: SameSite Lax Bypass via Method Override - PortSwigger]]
- [[raw/medium.com/web-security-academy-csrf-samesite-lax-bypass-via-method-override-4656|Web Security Academy: CSRF SameSite Lax Bypass via Method Override]]
- [[raw/logicbreaker.sh/samesite-lax-bypass-via-method-override-14234|SameSite Lax bypass via method override]]
- [[raw/portswigger.net/bypassing-samesite-cookie-restrictions-csrf-portswigger-2875|Bypassing SameSite Cookie Restrictions - CSRF - PortSwigger]]
- [[raw/bblabs.es/http-method-override-and-admin-bot-exploitation-csrf-lab-from-a-real-r-13766|HTTP method override and admin bot exploitation: CSRF lab from a real report]]
- [[raw/book.hacktricks.xyz/csrf-cross-site-request-forgery-hacktricks-2874|CSRF (Cross Site Request Forgery) - HackTricks]]
- [[raw/medium.com/csrf-the-bug-everyone-declared-dead-and-nobody-actually-fixed-13022|CSRF: The Bug Everyone Declared Dead and Nobody Actually Fixed]]
- [[raw/cobalt.io/csrf-bypasses-cobalt-3427|CSRF & Bypasses - Cobalt]]
- [[raw/vulncheck.com/vtenext-csrf-protection-bypass-via-http-method-tampering-13426|vtenext CSRF protection bypass via HTTP method tampering]]
- [[raw/github.com/flowintel-csrf-15520|FlowIntel CSRF]]
- [[raw/github.com/thelia-back-office-csrf-token-leak-get-deletes-13244|Thelia back-office CSRF token leak + GET deletes]]
- [[raw/github.com/omnispace-agora-project-csrf-14679|Omnispace Agora Project CSRF]]
- [[raw/github.com/visualticket-csrf-across-multiple-endpoints-14931|visualTicket CSRF across multiple endpoints]]
- [[raw/pickleoffsec.com/one-link-to-unlink-csrf-in-openai-discord-verification-service-12650|One Link to Unlink: CSRF in OpenAI Discord Verification Service]]
- [[raw/abraxaslabs.tech/webmin-2-670-firewalld-index-cgi-csrf-sets-zone-to-trusted-14677|Webmin 2.670 firewalld index.cgi CSRF sets zone to trusted]]
- [[raw/github.com/openmage-magento-lts-cross-site-request-forgery-critical-14534|OpenMage Magento LTS cross-site request forgery (critical)]]
- [[raw/github.com/apache-juneau-csrf-via-the-content-query-parameter-cve-2026-73099-13593|Apache Juneau CSRF via the content query parameter (CVE-2026-73099)]]
- [[raw/dedsecops.com/confirming-graphql-dast-findings-introspection-batching-depth-cost-csr-14495|Confirming GraphQL DAST findings: introspection, batching, depth/cost, CSRF over GET]]
- [[raw/cheatsheetseries.owasp.org/cross-site-request-forgery-prevention-cheat-sheet-owasp-2877|Cross-Site Request Forgery Prevention Cheat Sheet - OWASP]]
- [[raw/sajjapremsai.github.io/advanced-csrf-how-to-bypass-samesite-cookie-protections-3426|Advanced CSRF: How to Bypass SameSite Cookie Protections]]
- [[raw/k0z1l.github.io/portswigger-csrf-lab-samesite-lax-bypass-via-method-override-15858|PortSwigger CSRF lab: SameSite Lax bypass via method override]]