Skip to content
CSRF Write-up Intermediate

SameSite Strict Bypass via Client-Side Redirect — Testing with Sonnet 4.6 (Medium Effort)

The application's change email function lacked CSRF tokens and relied on SameSite=Strict cookies, but a client-side redirect endpoint could be abused to make a cross-site request appear same-site, causing the cookie to be sent. An attacker could then change the victim's email address without their consent.

osintteam.blog

Published on osintteam.blog

Discover how client-side redirects can undermine SameSite=Strict and reintroduce CSRF risk.

Bash Overflow, on osintteam.blog

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

Likely the application used a client-side redirect that caused the browser to treat a cross-site request as same-site, bypassing the SameSite=Strict cookie protection, and the change email function lacked CSRF tokens.

Impact

In a production environment, this weakness could allow attackers to perform unauthorized state-changing actions on behalf of authenticated users, even when applications rely on SameSite=Strict as their primary CSRF mitigation, potentially leading to account takeover via email change.

What the attacker needed

Victim is logged in; victim visits attacker-controlled page; client-side redirect endpoint exists

The fix

The application should implement dedicated CSRF defenses, such as unpredictable CSRF tokens, and avoid relying solely on SameSite=Strict for CSRF protection.

How it was found

  1. Open the lab and navigate to the login page.
  2. Log in to the application and analyse requests in Burp Suite's HTTP history.
  3. Inspect the application's JavaScript files to identify the client-side redirect endpoint.
  4. Craft a CSRF payload that uses the redirect endpoint to reach the change email function.
  5. Store the payload on the exploit server and deliver it to the victim.
  6. The lab is solved when the victim's email is changed.

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.

When you log into a website, your browser stores a cookie to remember you. The SameSite=Strict setting tells the browser not to send that cookie when you click a link from another site, which normally stops attackers from tricking you into performing actions. Here, the site had a redirect page that ran in your browser and made the request look like it came from the same site, so the cookie was sent and the email change went through.

What is CSRF?

Another site makes a signed-in user's browser perform an action they did not intend.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site request forgery (CSRF)

The lesson behind this report.

Another site makes a signed-in user's browser perform an action they did not intend.