Open Bug 1887577 Opened 2 months ago Updated 3 days ago

credential.create rejecting rpId when the document is XML encoded

Categories

(Core :: DOM: Web Authentication, defect, P3)

defect

Tracking

()

ASSIGNED

People

(Reporter: hubert.tonneau, Assigned: jschanck)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0

Steps to reproduce:

When calling credential.create() or credential.get(), if the web page is XML encoded as opposed to HTML, then using rp.Id (in create) or rpId (in get) will be rejected, probably because in 'RelaxSameOrigin' function, you have :
if (!document || !document->IsHTMLDocument()) {
return NS_ERROR_FAILURE;
}

The Bugbug bot thinks this bug should belong to the 'Core::DOM: Core & HTML' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → DOM: Core & HTML
Product: Firefox → Core
Version: other → unspecified

Demo available at :
https://copliant.storga.com/public/u2f_test.html
https://copliant.storga.com/public/u2f_test.xml
They are the same content, only the <!DOCTYPE> and <html> tags are different.
The demo is using a single tiny u2f_javascript.js script.

The HTML version will accept to register the Yubikey,
the XML version will raise Javascript exception 'DOMException: The operation is insecure.'

Component: DOM: Core & HTML → DOM: Credential Management

The severity field is not set for this bug.
:bvandersloot, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(bvandersloot)

:jschanck : do you want to triage this?

Flags: needinfo?(bvandersloot) → needinfo?(jschanck)

Sure, looks like we could replace that IsHTMLDocument() with IsHTMLOrXHTML().

Severity: -- → S3
Status: UNCONFIRMED → NEW
Component: DOM: Credential Management → DOM: Web Authentication
Ever confirmed: true
Flags: needinfo?(jschanck)
Priority: -- → P3
Assignee: nobody → jschanck
Status: NEW → ASSIGNED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: