Open Bug 1626158 Opened 4 years ago Updated 2 years ago

Obtaining a Web Manifest should reject if MIME type is not JSON

Categories

(Core :: DOM: Core & HTML, defect, P2)

defect

Tracking

()

People

(Reporter: marcosc, Unassigned)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

Attachments

(1 obsolete file)

When obtaining a Web Manifest, the spec now says we must reject if MIME type is not a JSON MIME type.

Assignee: nobody → mcaceres
Priority: -- → P2

The Web Manifest spec will now require that MIME Type be set and be a "JSON MIME Type".

Blocks: webmanifest

It needs to be noted that the spec may require it, but that's not decided yet (https://github.com/w3c/manifest/issues/821#issuecomment-609557743).

Previous experience at Mozilla around that was negative too, and I don't see any relevant data that can motivate this change.

Seems this needs to be done with XPIDL, which is not something I'm familiar with. I did some investigating and it seems XPIDL is not something documented in a usable way (i.e., it doesn't say how to bind to C++ files or how to get started or any functional examples), so it's not possible for me to proceed on this for now.

If someone else wants to take this over, please do. Otherwise, if someone knows XPIDL and wants to mentor me, I'd be happy to set aside some time.

The code to do this is all in Gecko, MIMEType.cpp has a parse() function that conforms to the WHATWG spec. However, without the XPIDL documentation, I won't have time to do it (from previous experience - one needs about 6-8 weeks to figure undocumented gecko stuff out).

Assignee: mcaceres → nobody
Depends on: 1632290

Previous experience at Mozilla around that was negative too, and I don't see any relevant data that can motivate this change.

Please see Mike West's rationale on GitHub. I think it makes sense to not throw arbitrary/incorrectly labelled data at the JSON parser, as it reduces the attack surface. Of course, an attacker could just change the MIME type and still try to confuse the parser, but at least it cuts down on the attack surface a bit.

Attachment #9138428 - Attachment is obsolete: true
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: