Skip to content
XSS Disclosed report Intermediate CVE-2021-43530

uxss on qrcode code reader (mozilla android version: 93.2.0 (Build #2015839747))

A QR code reader in Firefox for Android executed a javascript: URI when the user scanned a crafted QR code and approved the prompt, running script in the context of the page that was open. The reporter claims the confirmation dialog showed a misleading link, so the user could be tricked into running script that reads cookies.

Hafiizh Follow

Originally disclosed on Mozilla

  • Fixed in 5 days
  • Paid in 6 days
  • Disclosed after 5 days
Text
Created attachment 9246920
uxssmozilla.mpeg

hello i found uxss on qr code reader (mozilla android version: 93.2.0 (Build #2015839747), using the payload:

javascript:alert(document.cookie) // :<br>

https://www.google.com

the user will be confused because the link will be shown below ( on permit dialog show ).  example "http://google.com". the user can see that the link is "https://google.com"

step to produced:
1.  go to https://goqr.me  (to create qr code).
2. insert text : 
javascript:alert(document.cookie) // :<br>

https://www.google.com
3. the qr code will be created
4. open mozilla on android
5. go to https://google.com
6 . scan the qr code.
7. click permit, the user will be confused because the link will be shown below.  example "http://google.com"
8.  then the xss will be executed,

i attached the poc video file.
thank you

The original report as published on Mozilla's Bugzilla, by Hafiizh. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

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 scanner passed scanned text straight to a web view or intent handler without restricting the javascript: scheme, and the confirmation dialog displayed a different URL than the one actually executed.

What the attacker needed

Victim scans a crafted QR code; victim accepts the prompt; a page is open in the browser

How it was found

  1. Create a QR code containing a javascript: URI followed by a real site address.
  2. Open Firefox on Android and browse to a normal site.
  3. Scan the crafted QR code with the built-in reader.
  4. Approve the prompt, which shows a misleading link.
  5. The script runs in the context of the open page.

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 can hold a link, but it can also hold a 'javascript:' instruction that tells the browser to run code instead of opening a page. When the scanner offered to open it, the app ran that code inside the page the user already had open, so the code could read that site's cookies (small pieces of saved login data). The reporter says the confirmation box displayed a different, harmless-looking address, which made the trick easier to fall for.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More by Hafiizh

View all

78 more disclosed reports, best first.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.