Closed Bug 1499869 Opened 3 years ago Closed 3 years ago

An invalid credit card number stored in our autofill database blocks usage of the edit address and credit card dialogs


(Toolkit :: Form Autofill, defect, P1)




Tracking Status
firefox-esr60 --- unaffected
firefox63 --- disabled
firefox64 --- disabled
firefox65 --- verified


(Reporter: jaws, Assigned: jaws)



(Keywords: regression, Whiteboard: [webpayments])


(2 files, 1 obsolete file)

I have an invalid credit card number saved in my profile from testing.

When I go to the Edit Addresses dialog in Preferences, nothing appears and the browser console has:
Error: Invalid credit card number CreditCard.jsm:195:13 

The same happens for Edit Credit Cards.

It's odd too that credit card validation is happening when opening the address dialog.
Assignee: nobody → jaws
Flags: qe-verify?
Priority: -- → P1
Whiteboard: [webpayments] [triage] → [webpayments]
Attached image Screenshot of patch
The patch that I will attach will make the dialog usable again, but will not mask the number as you can see in this screenshot. We _could_ fix this, though the number is invalid so I'm less concerned about it.
Attachment #9018086 - Attachment mime type: text/plain → image/png
I was unable to figure out how to write a test for this, as all of our tests add credit cards to the initialized storage. In the process of adding a credit card to the storage, we normalize the fields and check that the credit card number is valid. Without a valid credit card number the card fails to get added to storage. I couldn't find a way through testing to populate the form autofill storage manually.
Attachment #9018090 - Attachment is obsolete: true
Comment on attachment 9018090 [details]
Bug 1499869 - Allow displaying of masked credit card numbers when they're invalid. r?MattN

Marking this version as obsolete since I don't know how to transfer phabricator patches from one machine to another, thus they lose the phabricator unique ID.
Attachment #9018090 - Attachment is obsolete: false
Attachment #9020358 - Attachment is obsolete: true
Attachment #9018090 - Attachment description: Bug 1499869 - Guard against invalid credit card numbers that may already be in our storage. r?MattN → Bug 1499869 - Allow displaying of masked credit card numbers when they're invalid. r?MattN
Verification steps: 
1) Use a build from many months ago and submit a 9 digit fake credit card (that doesn't pass the Luhn algorithm) in
2) Choose to save the record in autofill
3) Upgrade to an affected build and try to list the saved addresses or cards in Preferences
4) Delete the card from preferences and confirm it's actually gone by re-opening the dialog.
Flags: qe-verify? → qe-verify+
QA Contact: hani.yacoub
Pushed by
Allow displaying of masked credit card numbers when they're invalid. r=MattN
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
Verified - Fixed on latest Nigthly 65.0a1 (2018-11-14) (64-bit) on Windows 7/10 x64, Mac OS 10.13. and Ubuntu 16.04.
The invalid card saved on an older (07,2018) version can be deleted in the latest Nightly.
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.