TemporaryDocument window shares private-mode cookie with normal-mode
In Firefox for iOS, the TemporaryDocument webview shares its cookie store between private and normal browsing modes. An attacker could track a user who opens a PDF in private mode and then opens another PDF in normal mode, because the private-mode cookie is sent in normal mode.
Originally disclosed on Mozilla
- Fixed in 4.7 years
- Paid in 33 days
- Disclosed after 4.7 years
Created attachment 9195013
fxios-share-priv.gif
In Firefox for iOS, `TemporaryDocument` is used for viewing a non-HTML content in a webview (see following URL).
https://github.com/mozilla-mobile/firefox-ios/blob/ebe8a524fafa0a46b773cb39e8cd335512684478/Client/Frontend/Browser/Tab.swift#L141
TemporaryDocument shares its cookie store between private-mode and normal-mode.
So, a user opened a PDF file in private-mode can be tracked when he/she opened another PDF link in normal-mode.
Steps to reproduce:
1. In private-mode, open https://csrf.jp/2020/fxios_share/
2. Set your name in the form and push "Login" button
3. PDF file is shown in TemporaryDocument, you can see your name in the PDF document
4. Close all tabs in private-mode and switch to normal-mode
5. In normal-mode, open https://csrf.jp/2020/fxios_share/ again
6. Tap "Private 2" hyperlink that opens another PDF in normal-mode TemporaryDocument
7. Opened PDF shows your name even though you don't login to the site in normal-mode
See attached animation GIF for the demonstration.
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
Impact
A user who opens a PDF in private mode could be tracked when opening another PDF in normal mode, because the private-mode cookie is sent in normal mode.
What the attacker needed
Firefox for iOS; victim opens a PDF in private mode; victim later opens a PDF in normal mode
How it was found
- In private mode, open the test page.
- Set your name in the form and press Login.
- A PDF is shown in TemporaryDocument with your name.
- Close all private tabs and switch to normal mode.
- In normal mode, open the test page again.
- Tap the link that opens another PDF in normal-mode TemporaryDocument; it shows your name.
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 supposed to keep your cookies separate from normal browsing. Here, a special viewer for PDF files used the same cookie jar for both modes, so a website could recognise you in normal mode after you logged in during private mode.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.