Closed Bug 1803171 Opened 3 years ago Closed 3 years ago

FedCM Promise rejections on timeout cause tab crashes

Categories

(Core :: DOM: Credential Management, defect)

defect

Tracking

()

RESOLVED FIXED
109 Branch
Tracking Status
firefox109 --- fixed

People

(Reporter: bvandersloot, Assigned: bvandersloot)

References

(Blocks 1 open bug)

Details

Attachments

(1 external file)

If you have the following config:

dom.security.credentialmanagement.identity.enabled: true
dom.security.credentialmanagement.identity.select_first_in_ui_lists: false	
dom.security.credentialmanagement.identity.wait_for_timeout: true

Then any use of the API that leads to a the returned promise being rejected causes a tab crash. Running the following in the console is an easy reproduction condition:

return await navigator.credentials.get({
      identity: {
        providers: [{
          configURL: "https://idp.example/manifest.json",
          clientId: "123",
          nonce: 123
        }]
      }
    });

A likely candidate for the bug is the fun manual pointer management in IdentityCredential::DiscoverFromExternalSource required to make the timeout work.

I found the source of the crash. We need to grab a reference of the promise and release it after the callback fires and make sure we don't lose our promise ref when we return from this function.

Assignee: nobody → bvandersloot
Status: NEW → ASSIGNED
Blocks: 1803629
No longer blocks: 1788211
Pushed by bvandersloot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/021d5430a274 FedCM Promise rejections on timeout cause tab crashes, r=pbz
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 109 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: