Firefox Lite Full Address Bar Spoofing w/ Secure Padlock by Open Copied Link on the Address Bar
Categories
(Emerging Markets Graveyard :: Security: Firefox Lite, defect)
Tracking
(Not tracked)
People
(Reporter: sourc7, Assigned: st3fan)
References
Details
(Keywords: csectype-spoof, reporter-external, sec-moderate, Whiteboard: [reporter-external] [client-bounty-form] [verif?])
Attachments
(4 files, 4 obsolete files)
|
569.31 KB,
text/html
|
Details | |
|
412.56 KB,
video/mp4
|
Details | |
|
4.77 KB,
patch
|
Details | Diff | Splinter Review | |
|
2.14 KB,
patch
|
Details | Diff | Splinter Review |
It is possible to spoof Firefox Lite full address bar with secure padlock, by typing or pasting URL on website with empty response body (https://www.google.com/csi) or closed port (https://www.google.com:82) to the address bar.
While Firefox Lite loads the content, the target website URL stays on the address bar, so we can spoof current content using unbeforeunload event.
Browser tested:
Firefox Lite 2.5.2 (20647)
WebView version: 86.0.4240.198 (released on Nov 11th, 2020)
Steps to Reproduce:
- Visit attached testcase.html
- Tap "Copy URL"
- Tap on the address bar
- Tap "Open Copied Link"
- Address bar show: https://www.google.com/csi?response_type=auth&client_id=...
- Spoofed content show: Sign in to continue to Google Drive
Mitigation:
Currently I can't reproduce this on another WebView browser:
- FOSS Browser on Google Play
- Yandex Browser Lite
They do mitigate this spoof vulnerability by only displaying website on the address bar when it successfully loaded.
| Reporter | ||
Comment 1•5 years ago
|
||
Updated•5 years ago
|
Updated•5 years ago
|
Comment 2•5 years ago
|
||
"moderate" because of the user-interaction req'd (you can't navigate into this situation), but excellent spoof.
| Comment hidden (offtopic) |
| Comment hidden (offtopic) |
| Reporter | ||
Updated•5 years ago
|
| Comment hidden (offtopic) |
| Comment hidden (offtopic) |
Updated•5 years ago
|
| Comment hidden (offtopic) |
Updated•5 years ago
|
Comment 8•5 years ago
|
||
(In reply to Irvan Kurniawan (:sourc7) from comment #6)
... I think the perfectspoof.html should be reported as a separate bug, but I've mistakenly posted the detail on this bug. Is this ok :dveditz?
You're right: it's a separate (and worse!) issue. Created bug 1684986 to cover the new issue. I've also tagged comment 3 and following "offtopic" to hide them (so they don't derail any discussions about the original problem in this bug) but no disrespect is intended. It's a very good discovery and report.
Updated•5 years ago
|
| Reporter | ||
Comment 9•5 years ago
|
||
Thanks Daniel for the correction, firstly I think the bug has same underlying code, but after deep digging into mozilla-tw/FirefoxLite code it was a different issue.
| Assignee | ||
Comment 10•5 years ago
|
||
This bug is verified.
I've been reading through the code but it is not immediately obvious where this should be fixed. Ivan, I'm curious if you have any ideas. We will investigate more tomorrow.
| Reporter | ||
Comment 11•5 years ago
|
||
(In reply to Stefan Arentz | :st3fan | ⏰ EST | he/him from comment #10)
This bug is verified.
I've been reading through the code but it is not immediately obvious where this should be fixed. Ivan, I'm curious if you have any ideas. We will investigate more tomorrow.
Thanks Stefan, the bug is at BrowserFragment.kt at updateURL() call on following function:
the loadUrl code:
override fun loadUrl(
url: String,
openNewTab: Boolean,
isFromExternal: Boolean,
onViewReadyCallback: Runnable?
) {
updateURL(url)
and onUrlChanged code:
override fun onUrlChanged(session: Session, url: String?) {
chromeViewModel.onFocusedUrlChanged(url)
if (!isForegroundSession(session)) {
return
}
updateURL(url)
shoppingSearchPromptMessageViewModel.checkShoppingSearchPromptVisibility(url)
}
After tap "Open Copied Link", the updateURL() is called earlier to set the address bar to copied link's URL. So when user supplied url with empty response body, the WebViewClient is not navigating (stay on current page), but the address bar already set on that URL.
In this case we can follow Firefox for Android behavior, when the tab on the website is active (not in the new tab page) after tapping "Fill in links from clipboard", the address bar is not updated, because Firefox doesn't or failed to navigate to that URL.
I'll take a look if we can refactor the code to follow Firefox for Android behavior.
| Reporter | ||
Comment 12•5 years ago
|
||
Finally I able to refactor the code to follow Firefox for Android behavior, now it works like below:
When user entered URL on the address bar -> update the progress bar -> when page successfully loaded -> update the address bar.
| Reporter | ||
Comment 13•5 years ago
|
||
It turns out after removing webViewClient.notifyCurrentURL(url) it no longer pass the URL to BrowserFragment.kt onUrlChanged function; therefore on this updated patch I remove the unused condition check.
| Assignee | ||
Comment 14•5 years ago
|
||
Irvan, thank you so much for going beyond just reporting this issue. I'm going to review your patch and schedule a new release soon after.
| Reporter | ||
Comment 15•5 years ago
|
||
(In reply to Irvan Kurniawan (:sourc7) from comment #13)
Created attachment 9202017 [details] [diff] [review]
addressbarspoof.patchIt turns out after removing
webViewClient.notifyCurrentURL(url)it no longer pass the URL toBrowserFragment.ktonUrlChangedfunction; therefore on this updated patch I remove the unused condition check.
Thanks Stefan, surprisingly on some websites the onUrlChanged still receive the spoof URL, so I reverted to the previous patch.
Now I firmly sure this one solves the spoof issue.
| Reporter | ||
Comment 16•5 years ago
|
||
However I found a way to bypass the patch, on Firefox Lite it also update the address bar from WebViewClient onReceivedTitle callback. By adding document.title="newtitle" on beforeunload the address bar will also set to spoof URL.
Hereby I attach the additional patch to address the issue, it removes updateURL on WebViewClient onReceivedTitle callback, I also refactor address bar update code sequence on WebViewClient onPageStarted so the address bar will be updated quickly (same as using onReceivedTitle hack workaround).
Updated•5 years ago
|
| Assignee | ||
Comment 17•5 years ago
|
||
Irvan, apologies for the silence. We plan to ship this fix very soon. I am working on getting the patches in shape to get it out asap.
Comment 18•5 years ago
•
|
||
Verified as fixed on the latest FF Lite 2.6.1(20652) WebView 89.0.4389.90 (provided by Stefan) with Google Pixel 4 XL (Android 11) and Samsung Galaxy S7 (Android 7).
Note that following the steps from the description everything works as expected.
| Assignee | ||
Comment 19•5 years ago
|
||
This is shipping today to 25%. We'll keep an eye on it and then go to 100% later this week.
Updated•5 years ago
|
Updated•5 years ago
|
| Assignee | ||
Updated•5 years ago
|
| Assignee | ||
Comment 20•5 years ago
|
||
Since this shipped, I am marking this as ASSIGNED/RESOLVED. Will soon publish the CVE in the Github project.
Updated•5 years ago
|
| Reporter | ||
Comment 21•5 years ago
|
||
(In reply to Stefan Arentz | :st3fan | ⏰ EST | he/him from comment #20)
Since this shipped, I am marking this as ASSIGNED/RESOLVED. Will soon publish the CVE in the Github project.
Thank you Stefan for the update, I also confirmed this has been fixed on Firefox Lite 2.6.1(20652) (on Play Store) with WebView version: 89.0.4389.105.
Updated•4 years ago
|
Updated•1 year ago
|
Description
•