Skip to content
CSRF Disclosed report Intermediate

SameSite cookie bypass via redirect

A SameSite Strict cookie was still sent when a browser was redirected from an attacker-controlled page to the victim site. An attacker could therefore have their cross-site request carry the victim's Strict cookie, defeating the protection SameSite is meant to provide.

Jun Follow

Originally disclosed on Mozilla

  • Fixed in 24 hours
  • Paid in 12 days
  • Disclosed after 24 hours
Text
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36

Steps to reproduce:

1. Go to https://shhnjk.azurewebsites.net/SameSite.php (Sets SameSite cookie)
2. Copy https://test.shhnjk.com/location.php?url=https://shhnjk.azurewebsites.net/SameSite.php and paste it to new tab


Actual results:

SameSite Strict cookie sent


Expected results:

Redirect from attacker site to victim site shouldn't send SameSite Strict cookie. Reproed on Nightly.

The original report as published on Mozilla's Bugzilla, by Jun. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the browser treated a server-side redirect as a same-site navigation and did not re-check the original initiator when deciding whether to attach the Strict cookie.

Impact

A cross-site request that reaches the victim through a redirect could carry the Strict cookie, so SameSite Strict may not block the forged requests it is meant to stop; the report notes it reproduced on Nightly.

What the attacker needed

Victim visits an attacker-controlled page; attacker page redirects to victim site

How it was found

  1. Open the victim page that sets the SameSite cookie.
  2. Open a page on the attacker site that redirects to the victim page.
  3. Observe that the Strict cookie is sent on the redirected request.

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 report has not been written yet. The Original tab links to the source.

Websites store cookies in your browser to remember who you are. A setting called SameSite Strict is supposed to stop those cookies being sent when you arrive from a different website, which helps block forged requests. Here the browser still sent the cookie after a redirect, so the protection did not work as intended.

What is CSRF?

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

More by Jun

View all

17 more disclosed reports, best first.

More from Mozilla

View all

The newest disclosed reports for this program.

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.