Closed Bug 2081759 Opened 1 month ago Closed 11 days ago

Avoid primary password prompts when listing credit cards from the Rust store

Categories

(Toolkit :: Form Autofill, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox162 --- fixed

People

(Reporter: dimi, Assigned: dimi)

References

Details

(Whiteboard: [fxcm-backlog])

Attachments

(1 external file)

When the Rust credit card store uses the NSS key, every get_all_credit_cards call decrypts all card numbers. With a primary password set, this shows a primary password prompt to a user who only needs the list of cards (name, last four digits, expiry), and desktop then throws the decrypted numbers away because its records build the masked number from cc_number_last_4.

Today credit cards are only migrated to the Rust store when no primary password is set, but a migrated user can set one afterwards. Without lazy decryption, such a user could see a primary password prompt on every site with a credit card form until they fill a card.

https://github.com/mozilla/application-services/pull/7650 (bug 2080209) adds get_credit_card_without_number and get_all_credit_cards_without_numbers, which skip the encryptor and return records with an empty cc_number, as a scrubbed card looks.

Desktop should use these for every read path that does not need the full number (autocomplete suggestions, the manage credit cards dialog, field detection and other listing), and only call get_credit_card when the user actually selects a card to fill, edit, or view. If not all paths can move at once, the most frequent prompts (form autocomplete on page load) should go first.

Records built from the Rust store carry a mask of the last four digits, but
every read decrypted every number and security code, so with a primary
password set the prompt appeared on every page with a credit card form, in
the manage dialog and in settings. Records are now built from
CreditCardCandidates, and the number and security code are decrypted, together
and only when needed, to fill, edit, export or compare a card.

The security code now reads back masked like the number, so filling and the
edit dialog ask for both secrets with the new decryptFields, and an update
restores the stored code before merging so an omitted one is still kept.

A submitted card is compared only against the saved cards ending in the same
four digits, so a new card is offered for saving without a prompt and the key
is first needed when the user saves it.

The copy back to the JSON store relied on getAll() failing when the key cannot
decrypt the numbers, so it now checks that explicitly.

Attachment #9661336 - Attachment description: WIP: Bug 2081759 - P2. Read credit cards from the Rust store without decrypting them unless a secret is needed r?joschmidt,#credential-management-reviewers → WIP: Bug 2081759 - Read credit cards from the Rust store without decrypting them unless a secret is needed r?joschmidt,#credential-management-reviewers
Assignee: nobody → dlee
Attachment #9661336 - Attachment description: WIP: Bug 2081759 - Read credit cards from the Rust store without decrypting them unless a secret is needed r?joschmidt,#credential-management-reviewers → Bug 2081759 - Read credit cards from the Rust store without decrypting them unless a secret is needed r?joschmidt
Status: NEW → ASSIGNED
Pushed by dlee@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/9c1896744b68 https://hg.mozilla.org/integration/autoland/rev/51cafbd5b3fb Read credit cards from the Rust store without decrypting them unless a secret is needed r=joschmidt,credential-management-reviewers,NeilDeakin,mtigley,mossop,theidkamp
Pushed by smolnar@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/af89bbb2d5f8 https://hg.mozilla.org/integration/autoland/rev/2f553ffae71a Revert "Bug 2081759 - Read credit cards from the Rust store without decrypting them unless a secret is needed r=joschmidt,credential-management-reviewers,NeilDeakin,mtigley,mossop,theidkamp" for causing bc failures @ browser_creditCard_telemetry_cvv.js
Pushed by dlee@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/23478a78ae24 https://hg.mozilla.org/integration/autoland/rev/94f4895b13c7 Read credit cards from the Rust store without decrypting them unless a secret is needed r=joschmidt,credential-management-reviewers,NeilDeakin,mtigley,mossop,theidkamp
Flags: needinfo?(dlee)
Whiteboard: [fxcm-backlog]
Status: ASSIGNED → RESOLVED
Closed: 11 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
Blocks: 2095199
QA Whiteboard: [qa-triage-done-c163/b162]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: