-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Which doctype and root element to use #72
Comments
I have questions that probably stem from not understanding the security issues here. Bear with me, please.
Loading a mapml document OR an HTML document from
What information would be leaked? I am free to point my
I don't understand this. Scripting would be disabled imho. Why would loading a text/mapml document into a top level context be something to circumvent? I think it's like when you have the URL of a png file, the browser generates a page around the url, with an embedded
Correct, I think, per the discussion above?
Are you saying that the <!doctype mapml> is the right approach (when the media type switching isn't available so you have to sniff)? In the case that we adopt the xhtml namespace, |
@zcorpan We recently completed a feature on the mapml-extension that allows it to intercept responses to top-level contexts (tabs) that are returned with the In doing this work, we noticed that the browser will similarly wrap a My question here is, and perhaps it's more of a comment than a question :-), is that if the browser recognized Your thoughts below, appreciated as usual. |
Spun off from #70 (comment)
The MIME type is appropriate for switching processing generally. The doctype is used for switching between quirks mode, limited-quirks and no-quirks, but shouldn't be used as a mechanism for new switches. With a new MIME type, the HTML parser can be configured to force no-quirks and thus make the doctype optional. This is already done for
<iframe srcdoc="...">
.For the root element, what would it do? It mostly doesn't do anything in HTML, and MapML could similarly not do anything with it.
There are two cases:
<layer src>
<iframe src>
etc)In the first case, you could ignore even the MIME type, but that is not recommended because ignoring MIME types have a history of security problems and the trend is to enforce MIME types where possible. You could allow both text/html and text/mapml, but being strict and only successfully loading text/mapml seems better for security:
<layer src>
pointing to victim HTML page and have it leak informationtext/html
in<layer>
can allow attackers to trick users into loading the MapML document in a top-level browsing context (e.g. by emailing a link or through ads) and circumvent those restrictions.In the second case, you'd need something if there is to be a processing difference between showing an HTML document and showing a MapML document (which appears to be desired). The MIME type is the right tool here I think.
When loading from local file system, it's more common to have file extensions be the equivalent source of truth as MIME types do on the web. But this might need cooperation from the OS for some OSes. I don't know enough about how this works, but having HTML and MapML needing different processing and not being able to tell them apart from sniffing seems like it can be a problem. It might even be a problem on the web.
That said, if we want a sniffable signature for MapML, those are most effective if the signature is required to be right at the start and be a fixed amount of bytes (like XML's "
<?xml
"). Those bytes could be the characters "<!doctype mapml>
" (ascii case-insensitive). But again this would be sniffing to verify the format and happen before the HTML parser consumes those characters.The text was updated successfully, but these errors were encountered: