Sensitive user data leak via Reader function from other applications
Categories
(Firefox for iOS :: Reader View, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| fxios | 151.0 | --- |
People
(Reporter: sdna.muneaki.nishimura, Assigned: ih-codes)
References
Details
(4 keywords)
Attachments
(2 files)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36
Steps to reproduce:
- Launch Firefox iOS on the iPad.
- Open "iSH" app in Split View to run both apps side-by-side.
- Login to Bugzilla on Firefox iOS
- Run
curl http://localhost:6571/reader-mode/page?url=https://bugzilla.mozilla.org/userprefs.cgi?tab=apikeytwice on iSH - You can find Bugzilla API Keys of logged-in user in the curl response
Actual results:
Please see the attached video for instructions on how to reproduce the bug.
Firefox iOS's ReaderView is hosted at http://localhost:6571.
This URL can be easily opened from other apps, so in the legacy code, it was protected by Basic authentication on a local web server.
However, Basic authentication has been omitted in the currently used source code, allowing other apps to access ReaderView.
The ReaderView URL converts any page specified in the query parameters into readable content and displays it. User cookies are used for this process.
In the curl command example above, by specifying the URL of the Bugzilla API key page, it was possible to steal the user’s API key by another app installed on the same device (in this case, "iSH") through the ReaderView.
In addition, it was possible to steal various types of data, such as private Gists, if the user was logged into GitHub.
Expected results:
Just like with legacy code, localhost should be protected with Basic authentication.
| Reporter | ||
Comment 1•7 months ago
|
||
Attached is a demonstration movie (animation GIF).
Updated•7 months ago
|
| Reporter | ||
Comment 2•7 months ago
|
||
I just discovered that Firefox for iOS has the following security policy:
https://github.com/mozilla-mobile/firefox-ios/security/policy
I forgot to submit this report via the Client Bug Bounty Form. If there are any other actions I need to take besides creating this Bugzilla report in order to receive bug bounty triage, please let me know.
Updated•7 months ago
|
Updated•7 months ago
|
| Assignee | ||
Comment 5•7 months ago
|
||
For internal reference, here is the FXIOS ticket tracking this bug: https://mozilla-hub.atlassian.net/browse/FXIOS-15752
Thanks to help from Jan and Issam, I have a fix up here: https://github.com/mozilla-mobile/firefox-ios/pull/33684
For posterity, I'll explain why we removed the basic auth for reader mode and why we can now add it back in.
Back in January, we had a "blank reader mode" bug (https://github.com/mozilla-mobile/firefox-ios/issues/31492). If I recall correctly, this bug was only reproducible in production builds (Firefox, FirefoxBeta), not developer builds (Fennec).
Around that same time, we were migrating to strict concurrency and Swift 6. It turns out, two WebKit delegate methods were compiled out of the code. This issue was tracked here: https://github.com/mozilla-mobile/firefox-ios/issues/31789#issuecomment-3787006772
The methods that were compiled out had to be rewritten using the async-await API instead. One of these methods was related to basic auth handling. Because this auth-related code was literally compiled out of the app due to WMO (whole module optimization) on release builds, we were failing the auth check for Reader Mode URLs as well and naively thought the solution was to remove the check. Shorlty later we realized the migration had caused a much larger issue and didn't connect the dots until now. Today, the basic auth method is implemented correctly and we are on Swift 6, so we can safely replace the basic auth on the Reader Mode calls. As far as I could tell when testing, I was no longer able to access the page using a curl command. We have a new nightly build uploading to TestFlight as I write this, so we can double check with a release build next.
Ultimately, we should not be using GCDWebServer to serve internal URLs like this for Reader Mode. For future reference, we do have a refactor ticket to address this, but it is not prioritized: https://mozilla-hub.atlassian.net/browse/FXIOS-14567
Comment 6•6 months ago
•
|
||
Verified as fixed on v151.0 (71676) with iPad Air (18.5).
Here you can see the attachments.
Following the steps from the description, I can confirm that this issue no longer occurs on the latest version.
The 401 Unauthorized error was returned.
Updated•6 months ago
|
Updated•6 months ago
|
Updated•6 months ago
|
Updated•6 months ago
|
Updated•6 months ago
|
Updated•3 months ago
|
Description
•