Localhost navigation bypass with QR code scanner
The QR code scanner in Firefox for iOS did not block navigation to localhost URLs, allowing an attacker to launch privileged localhost features such as reader-mode. This could be used to exploit existing bugs on the localhost service, including HTML injection and address bar spoofing.
Originally disclosed on Mozilla
- Fixed in 4.7 years
- Paid in 2.8 years
- Disclosed after 4.7 years
Created attachment 8892339
QR.png
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/603.3.8 (KHTML, like Gecko) Version/10.1.2 Safari/603.3.8
Steps to reproduce:
QR code scanner on Firefox for iOS allows to launch privileged localhost features such as reader-mode.
It allows an attacker to exploit existing bugs on http://localhost:6571.
For example, the QR code I attached stores following URL.
http://localhost:6571/reader-mode/page?url=https://goo.gl/5YG6s2
Actual results:
When you scan the code with Firefox for iOS reader-mode window is launched (localhost navigation block bypass).
Then the address bar shows "https://goo.gl/5YG6s2" but the window shows a page of GitHub under HTML injection attack.
Here an attacker can abuse existing two bugs on reader-mode, that are Bug 1224425 (HTML injection) and Bug 1293070 (address bar spoofing).
Expected results:
Nagigation for http://localhost:6571/ should be blocked.
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
Likely the QR code scanner did not apply the same localhost navigation blocking that other navigation paths enforce.
Impact
An attacker could exploit existing bugs on the localhost reader-mode service, such as HTML injection and address bar spoofing, to display misleading content.
What the attacker needed
Victim scans a malicious QR code; Firefox for iOS with QR scanner
How it was found
- Create a QR code that encodes a URL pointing to the localhost reader-mode endpoint with a target URL parameter.
- Scan the QR code using Firefox for iOS.
- Observe that the reader-mode window opens, bypassing the localhost navigation block.
- The address bar shows the target URL while the page displays attacker-controlled content due to existing reader-mode bugs.
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.
A QR code scanner in a mobile browser should not let a scanned code open internal addresses like localhost, which are meant only for the device itself. Here, scanning a crafted QR code opened a local service and triggered a feature that could be abused to show fake content and a misleading address bar.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.