Skip to content
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

Remove <object typemustmatch> #4590

Merged
merged 2 commits into from May 3, 2019
Merged

Remove <object typemustmatch> #4590

merged 2 commits into from May 3, 2019

Conversation

annevk
Copy link
Member

@annevk annevk commented May 3, 2019

It did not get wide enough adoption and causes a minor cross-origin leak.

See https://lists.w3.org/Archives/Public/public-whatwg-archive/2011Jun/0144.html for its introduction and https://github.com/xsleaks/xsleaks/wiki/Browser-Side-Channels#object-typemustmatch for the leak.

(See WHATWG Working Mode: Changes for more details.)


/iframe-embed-object.html ( diff )
/indices.html ( diff )
/obsolete.html ( diff )

@annevk annevk added the removal/deprecation Removing or deprecating a feature label May 3, 2019
@zcorpan
Copy link
Member

zcorpan commented May 3, 2019

How does the leak of the content-type compare to the risk the attribute is supposed to help with? Can we still address the original attack somehow?

  <p class="warning">Authors who reference resources from other <span data-x="origin">origins</span>
  that they do not trust are urged to use the <code
  data-x="attr-object-typemustmatch">typemustmatch</code> attribute defined below. Without that
  attribute, it is possible in certain cases for an attacker on the remote host to use the plugin
  mechanism to run arbitrary scripts, even if the author has used features such as the Flash
  "allowScriptAccess" parameter.</p> <!-- for example, if the user doesn't have flash installed but
  does have java installed, and the remote site unexpectedly returns java instead of flash, then
  java will run, and it will ignore the allowScriptAccess thing -->

Java is not available anymore, but the attack could be to load HTML instead of Flash, or Flash instead of an image or PDF.

This functionality can be used to determine whether the response has the Content-type: text/html because if the embedded object was loaded successfully the number of frames will increase.

So this allows for stricter checking if something is of a particular content-type compared to other features.

Worth to mention, typemustmatch also ensures that the server responded with a 200 OK header or the resource won't be loaded otherwise. Hence, it is possible to detect error pages as well.

I think this is possible regardless of typemustmatch (per spec).

@annevk
Copy link
Member Author

annevk commented May 3, 2019

Basically, do not use object or embed to load untrusted resources, as I wrote in the obsolete section. Plugins are slowly going away and there's not much motivation from anyone to further invest in these elements I think.

(I agree that 2xx is exposed either way, not sure why that was mentioned as part of this attribute.)

@zcorpan
Copy link
Member

zcorpan commented May 3, 2019

I think we should still have a warning for embed and object about the risk of loading an untrusted resource, and trying to use type-specific sandboxing techniques (like "allowScriptAccess" for Flash).

Also we should probably more directly recommend to use iframe for HTML (and PDF?) and img for images, instead of embed/object. (This can be separate though.)

@annevk annevk merged commit 2606f90 into master May 3, 2019
@annevk annevk deleted the annevk/rm-typemustmatch branch May 3, 2019 12:18
annevk added a commit to web-platform-tests/wpt that referenced this pull request May 3, 2019
Apart from Firefox nobody adopted this and it creates a smallish cross-origin leak. whatwg/html#4590 changes the HTML standard.
marcoscaceres pushed a commit to web-platform-tests/wpt that referenced this pull request Jul 23, 2019
Apart from Firefox nobody adopted this and it creates a smallish cross-origin leak. whatwg/html#4590 changes the HTML standard.
@sideshowbarker sideshowbarker added the impacts documentation Used by documentation communities, such as MDN, to track changes that impact documentation label Sep 2, 2019
@sideshowbarker
Copy link
Contributor

heads-up @whatwg/documentation

sideshowbarker added a commit to mdn/content that referenced this pull request Mar 30, 2021
This change deletes the Web/API/HTMLObjectElement/typeMustMatch
article, as well a expunging all references to it from other articles.
The change also drops all mentions of the corresponding “typemustmatch”
markup attribute for “object” elements.

The history of typeMustMatch/typemustmatch is that it was added to the
spec in 2011 in whatwg/html@4030e71 but never
got implemented across browsers and never got adopted by web developers.
So whatwg/html#4590 dropped it from the spec in
2019, and it's now just a footnote in the Non-conforming features section
at https://html.spec.whatwg.org/obsolete.html#attr-object-typemustmatch

So there's statistically near-zero content on the web that’s using
typeMustMatch/typemustmatch, and there’s no value to continue
documenting it in MDN.
sideshowbarker added a commit to mdn/content that referenced this pull request Mar 30, 2021
This change deletes the Web/API/HTMLObjectElement/typeMustMatch
article, as well a expunging all references to it from other articles.
The change also drops all mentions of the corresponding “typemustmatch”
markup attribute for “object” elements.

The history of typeMustMatch/typemustmatch is that it was added to the
spec in 2011 in whatwg/html@4030e71 but never
got implemented across browsers and never got adopted by web developers.
So whatwg/html#4590 dropped it from the spec in
2019, and it's now just a footnote in the “Non-conforming features” section
at https://html.spec.whatwg.org/obsolete.html#attr-object-typemustmatch

So there's statistically near-zero content on the web that’s using
typeMustMatch/typemustmatch, and there’s no value to continue
documenting it in MDN.
sideshowbarker added a commit to mdn/content that referenced this pull request Mar 30, 2021
This change deletes the Web/API/HTMLObjectElement/typeMustMatch
article, as well as expunging all references to it from other articles.
The change also drops all mentions of the corresponding “typemustmatch”
markup attribute for “object” elements.

The history of typeMustMatch/typemustmatch is that it was added to the
spec in 2011 in whatwg/html@4030e71 but never
got implemented across browsers and never got adopted by web developers.
So whatwg/html#4590 dropped it from the spec in
2019, and it's now just a footnote in the “Non-conforming features” section
at https://html.spec.whatwg.org/obsolete.html#attr-object-typemustmatch

So there's statistically near-zero content on the web that’s using
typeMustMatch/typemustmatch, and there’s no value to continue
documenting it in MDN.
sideshowbarker added a commit to w3c/browser-compat-data that referenced this pull request Mar 30, 2021
This change deletes “typeMustMatch” from api/HTMLObjectElement.json
and deletes “typemustmatch” from html/elements/object.json.

The history of typeMustMatch/typemustmatch is that it was added to the
spec in 2011 in whatwg/html@4030e71 but never
got implemented across browsers and never got adopted by web developers.
So whatwg/html#4590 dropped it from the spec in
2019, and it's now just a footnote in the “Non-conforming features” section
at https://html.spec.whatwg.org/obsolete.html#attr-object-typemustmatch

So there's statistically near-zero content on the web that’s using
typeMustMatch/typemustmatch, and there’s no value to continue
tracking support data for it in BCD.

Related MDN content change: mdn/content#3655
chrisdavidmills pushed a commit to mdn/content that referenced this pull request Mar 30, 2021
This change deletes the Web/API/HTMLObjectElement/typeMustMatch
article, as well as expunging all references to it from other articles.
The change also drops all mentions of the corresponding “typemustmatch”
markup attribute for “object” elements.

The history of typeMustMatch/typemustmatch is that it was added to the
spec in 2011 in whatwg/html@4030e71 but never
got implemented across browsers and never got adopted by web developers.
So whatwg/html#4590 dropped it from the spec in
2019, and it's now just a footnote in the “Non-conforming features” section
at https://html.spec.whatwg.org/obsolete.html#attr-object-typemustmatch

So there's statistically near-zero content on the web that’s using
typeMustMatch/typemustmatch, and there’s no value to continue
documenting it in MDN.
foolip pushed a commit to mdn/browser-compat-data that referenced this pull request Mar 30, 2021
This change deletes “typeMustMatch” from api/HTMLObjectElement.json
and deletes “typemustmatch” from html/elements/object.json.

The history of typeMustMatch/typemustmatch is that it was added to the
spec in 2011 in whatwg/html@4030e71 but never
got implemented across browsers and never got adopted by web developers.
So whatwg/html#4590 dropped it from the spec in
2019, and it's now just a footnote in the “Non-conforming features” section
at https://html.spec.whatwg.org/obsolete.html#attr-object-typemustmatch

So there's statistically near-zero content on the web that’s using
typeMustMatch/typemustmatch, and there’s no value to continue
tracking support data for it in BCD.

Related MDN content change: mdn/content#3655
aarongable pushed a commit to chromium/chromium that referenced this pull request Jan 24, 2022
This just removes one commented out line. There are no functional
changes.

typeMustMatch was removed from the HTML spec here:
whatwg/html#4590

I don't believe any other browser implemented this.

Bug: 897442
Change-Id: I543a8c84273bfbfef6d9ff2225a49fa1d1105965
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3413353
Commit-Queue: Joey Arhar <jarhar@chromium.org>
Reviewed-by: Mason Freed <masonf@chromium.org>
Cr-Commit-Position: refs/heads/main@{#962645}
mjfroman pushed a commit to mjfroman/moz-libwebrtc-third-party that referenced this pull request Oct 14, 2022
This just removes one commented out line. There are no functional
changes.

typeMustMatch was removed from the HTML spec here:
whatwg/html#4590

I don't believe any other browser implemented this.

Bug: 897442
Change-Id: I543a8c84273bfbfef6d9ff2225a49fa1d1105965
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3413353
Commit-Queue: Joey Arhar <jarhar@chromium.org>
Reviewed-by: Mason Freed <masonf@chromium.org>
Cr-Commit-Position: refs/heads/main@{#962645}
NOKEYCHECK=True
GitOrigin-RevId: a4364091c2967d843d1f49df1146f23d1db1577f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impacts documentation Used by documentation communities, such as MDN, to track changes that impact documentation removal/deprecation Removing or deprecating a feature topic: embed and object
Development

Successfully merging this pull request may close these issues.

None yet

3 participants