SameSite Lax Bypass via Method Override
The application used SameSite=Lax cookies as its main CSRF defence but also supported a method override parameter. An attacker could craft a cross-site GET request that the server treated as a POST, changing the victim's email address without consent.
osintteam.blog
Published on osintteam.blog
This lab demonstrates a CSRF vulnerability in an email change feature that relies on SameSite=Lax cookies as the primary defense mechanism. The application assumes that the browser will not send session cookies during cross-site requests, preventing unauthorized actions.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The application relied on SameSite=Lax for CSRF protection but also honoured a method override parameter, allowing a GET request to be processed as a state-changing POST.
Impact
An attacker could perform state-changing actions such as changing the victim's email address, modifying profile data, or triggering password reset flows, even when SameSite cookies are enabled.
What the attacker needed
Victim logged in; victim visits attacker page; application supports method override
How it was found
- Log in and change the email address to observe the POST request.
- Send the request to Repeater and generate a CSRF PoC.
- Modify the email parameter and deliver the exploit; it fails because the browser redirects to login.
- Change the request method from POST to GET in Repeater; the server returns Method Not Allowed.
- Create a new CSRF PoC that includes a hidden _method parameter set to POST and auto-submits as a GET.
- Deliver the updated exploit; the lab is solved, confirming the email change.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
CSRF is when a malicious site makes your browser send a request to another site where you are logged in. SameSite=Lax is a cookie setting that normally stops cookies from being sent on cross-site requests, except for top-level GET navigations. Here, the server also accepted a hidden parameter that changed the request method from GET to POST, so the cookie was sent and the action succeeded.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.