Skip to content
CSRF Disclosed report Intermediate CVE-2022-45413

SameSite=Strict cookie bypass on Android via fallback URLs in intent:// scheme

Firefox on Android did not enforce SameSite=Strict cookies when loading a URL from the S.browser_fallback_url parameter of an intent:// scheme. An attacker could cause a victim's browser to send SameSite=Strict cookies cross-site without user interaction.

haxatron1 Follow

Originally disclosed on Mozilla

  • Fixed in 26 days
  • Paid in 32 days
  • Disclosed after 26 days
Text
Created attachment 9295084
cookie.php

SameSite=Strict cookies can be sent cross-site (without user interaction) via the intent URLs. Consider the following URL:
'''`
intent://192.168.1.70#Intent;scheme=http;package=garbage;S.browser_fallback_url=http://192.168.1.70:8000/cookie;end
'''` 
On Android, the S.browser_fallback_url parameter specifies the URL to load when the browser fails to verify the intent. As the intent above is invalid due to the invalid package name, then Firefox browser will not open another app but instead open the URL http://192.168.1.70:8000/cookie.

When opening the fallback_url parameter, it doesn't take into account the passing of SameSite=Strict cookie, as such, an attacker can just redirect a user to the URL intent://192.168.1.70#Intent;scheme=http;package=garbage;S.browser_fallback_url=http://192.168.1.70:8000/cookie;end and the cookies will get passed on.

STR:
1. Download attached files.
2. Host cookie.php on Site A, intent-redirect.php on Site B. Remember to change the URL in intent-redirect.php to Site B!
3. Visit cookie.php on Site A to retrieve SameSite cookies
4. Open a listener on Site A, then visit intent-redirect.php on Site B 
5. The SameSite cookie gets sent to cross-site from Site B to Site A.
'''` 
└─$ nc -nvlp 8000
listening on [any] 8000 ...
connect to [192.168.1.70] from (UNKNOWN) [192.168.1.127] 43784
GET /cookie HTTP/1.1
Host: 192.168.1.70:8000
User-Agent: Mozilla/5.0 (Android 11; Mobile; rv:104.0) Gecko/104.0 Firefox/104.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Language: en-GB
Accept-Encoding: gzip, deflate
Connection: keep-alive
Cookie: a=b
Upgrade-Insecure-Requests: 1
'''`

The original report as published on Mozilla's Bugzilla, by haxatron1. 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 the fallback URL load as a top-level same-site navigation rather than a cross-site request, so it did not apply the SameSite=Strict restriction.

Impact

An attacker could cause a victim's SameSite=Strict cookies to be sent cross-site without user interaction, potentially enabling cross-site request forgery or other cookie-dependent attacks.

What the attacker needed

Victim uses Firefox on Android; victim visits attacker-controlled page

How it was found

  1. Host a page on Site A that sets a SameSite=Strict cookie.
  2. Host a page on Site B that redirects to an intent:// URL whose fallback URL points to Site A.
  3. Visit the Site A page to obtain the cookie.
  4. Start a listener on Site A, then visit the Site B page.
  5. Observe the SameSite cookie being sent from Site B to Site A.

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.

Cookies marked SameSite=Strict are supposed to be sent only when you navigate directly to the same site, not when another site causes your browser to load it. On Android, a special link type called intent:// can include a fallback web address that the browser opens if the intent fails. This report shows that Firefox opened that fallback address as if it were a direct navigation, so the strict cookie was sent even though the request came from another site.

What is CSRF?

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

More by haxatron1

View all

30 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.