Web Notification API in Fenix shares private mode cookie with normal mode
The Web Notification API's icon request in Fenix is made from native code using a cookie store shared between private and normal browsing modes, and this store is not cleared by the 'Delete browsing data on quit' feature. An attacker can therefore track users across private and normal modes and retain a cookie after restart.
Originally disclosed on Mozilla
- Fixed in 8 days
- Paid in 18 days
- Disclosed after 8 days
Created attachment 9169077
notification_tracker.gif
Similar to Bug 1657251, `icon` request of Web Notification API in Fenix shares private browsing mode cookie with normal browsing mode. Also the cookie value is kept after restart even when `Delete browsing data on quit` is enabled.
The reason is that `icon` request is sent from native code and that shares cookie store between private and normal mode. Also, it that cookie store is not in scoped of `Delete browsing data on quit` feature.
https://github.com/mozilla-mobile/android-components/blob/master/components/feature/webnotifications/src/main/java/mozilla/components/feature/webnotifications/NativeNotificationBridge.kt#L74
That allows website to track his/her users even when they use private browsing mode.
Here is the reproduction way (see attached image for the demo).
1. Launch https://csrf.jp/2020/notification in normal browsing mode
2. Set the name 'public' to form and submit
3. Tap "Enable Notification" button and allow for the domain
4. Launch https://csrf.jp/2020/notification in private browsing mode
5. Set the name 'private' to form and submit
6. Tap "Enable Notification" button again and allow for the domain
7. Tap "Show Notification" button (in private mode tab)
8. Fenix tries to retrieve `icon` to tracker.php and then tracking cookie `user=private` is set by the response
8. Open the normal browsing mode tab 1)
9. Tap "Show Notification" button (in normal mode tab)
10. Fenix sends `icon` request to tracker.php with `user=private` in cookie that is set by 8)
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 native code that fetches notification icons uses a cookie store shared between private and normal browsing modes, and that store is outside the scope of the 'Delete browsing data on quit' feature.
Impact
A website could track users across private and normal browsing modes, and the tracking cookie may persist after restart even when 'Delete browsing data on quit' is enabled.
What the attacker needed
Fenix browser on Android; User enables notifications for the site; User visits the site in both modes
How it was found
- Open the test page in normal browsing mode and submit a name.
- Enable notifications for the domain and allow it.
- Open the same page in private browsing mode and submit a different name.
- Enable notifications again and allow for the domain.
- Tap 'Show Notification' in the private tab so the icon request sets a cookie.
- Switch to the normal mode tab and tap 'Show Notification' to see the private cookie sent.
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 your activity separate from normal browsing. In this bug, when a website shows a notification, the browser fetches the notification's icon using a shared cookie storage, so a cookie set in private mode can be read in normal mode and even survives a restart. This lets a website recognise the same person in both modes.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.