Skip to content
XSS Disclosed report Intermediate

UXSS through credit card autofill feature on Firefox iOS

The credit card autofill feature in Firefox iOS injected user-supplied card data into JavaScript without proper escaping, allowing stored cross-site scripting. An attacker could register a malicious card and then trigger script execution on any site where autofill was used, such as a checkout page.

Muneaki Nishimura Follow

Originally disclosed on Mozilla

  • Fixed in 26 days
  • Paid in 27 days
  • Disclosed after 26 days
Text
The credit card autofill feature is enabled by default in the main branch of Firefox iOS codebase.
This feature is vulnerable to UXSS because it injects JavaScript code built with concatenated strings that contains user input in the following swift code.
https://github.com/mozilla-mobile/firefox-ios/blame/8d49c2bb9378b9e867644437cf53db0ed2f7236b/Client/Frontend/TabContentsScripts/CreditCardHelper.swift#L135

An attacker can perform UXSS attacks on any sites by inserting malicious JavaScript into the users credit card information through the registered card update feature.

Steps to reproduce:
1. Register credit card information on the setting page.
2. Open https://csrf.jp/2023/cc-fxios.html
3. Tap credit card input form and autofill registered credit card info.
4. Tap submit button.
5. At this time, a dialog box appears asking if you want to update the registered credit card info.
6. Choose update card info. Then, malicious JavaScript code is injected into the card info.
7. Open https://checkout.stripe.dev/
8. Try to autofill registered credit card info in the form
9. Alert dialog with 'XSS' is shown on checkout.stripe.dev domain.

See attached video that reproduces above steps.

The original report as published on Mozilla's Bugzilla, by Muneaki Nishimura. 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 autofill script built JavaScript by concatenating user-controlled card fields without escaping, leading to script injection.

Impact

An attacker could run arbitrary JavaScript on any site where the victim autofills the malicious card, potentially stealing data or performing actions as the user.

What the attacker needed

Firefox iOS with credit card autofill enabled; Victim saves a malicious card via attacker page; Victim autofills card on a target site

How it was found

  1. Register credit card information on the setting page.
  2. Open the attacker's test page.
  3. Tap the credit card input form and autofill the registered card.
  4. Tap submit and choose to update the card info, injecting malicious JavaScript.
  5. Open a checkout test site and autofill the card.
  6. An alert dialog with 'XSS' appears on the checkout domain.

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.

When you save a credit card in a browser, the browser later fills in those details on shopping sites. This report found that the browser was not safely handling the saved card details, so a malicious card could contain hidden code. That code would then run on any website where the card was autofilled, which is a type of cross-site scripting (XSS).

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 Muneaki Nishimura

View all

74 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.