File download request in Firefox iOS shares private browsing mode cookie
Firefox iOS shares cookies between private and normal browsing modes when a file download is triggered, because the download client does not check the browsing context. An attacker could set a tracking cookie in private mode and later read it in normal mode, or vice versa, breaking private browsing isolation.
Originally disclosed on Mozilla
- Fixed in 7 months
- Paid in 8 months
- Disclosed after 7 months
Created attachment 9180571
fxios_private_bypass_by_download.mp4
Similar to Bug 1663261 in Fenix, Firefox iOS also shares private mode cookie with normal browsing context.
When user taps download link, actual file download request is sent from Swift side HTTP client (below).
https://github.com/mozilla-mobile/firefox-ios/blob/1aa4bb892c60ff346df0eab30691578282947618/Client/Frontend/Browser/DownloadQueue.swift#L58
But this client doesn't check whether the requested browsing context was private mode or not.
Steps to reproduce the issue is below:
1. Visit http://csrf.jp/2020/dl_fxios in private browsing mode
2. Tap `set_cookie.php` link, then a tracking cookie `id` is set
3. Visit http://csrf.jp/2020/dl_fxios again in normal browsing mode
4. Tap `get_cookie.php` link, then the recorded cookie `id` in step 2 is shown in the downloaded contents
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
The download HTTP client does not check whether the requested browsing context is private, so it uses the shared cookie store.
What the attacker needed
Firefox iOS app; victim visits attacker page in private mode; victim later visits same page in normal mode
How it was found
- Visit a test page in private browsing mode.
- Tap a link that sets a tracking cookie.
- Visit the same test page in normal browsing mode.
- Tap a link that downloads a file showing the recorded cookie.
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.
Private browsing is meant to keep cookies separate from normal browsing. Here, when you download a file, the app uses a separate download component that ignores whether you are in private mode, so cookies set in private mode can be seen in normal mode. This lets a website track you across modes.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.