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

(outdated) Firefox 72 allows for MIME sniffing on top-level documents when no Content Type is set #25371

Closed
wants to merge 2 commits into from

Conversation

bsmth
Copy link
Member

@bsmth bsmth commented Dec 10, 2024

edit: See #25371 (comment)

Summary

Adding impl_ulrs for some HTTP features. These were documented in MDN content prose, and removed in recent PRs.

Related issues

Follow-up from:

@github-actions github-actions bot added the data:http Compat data for HTTP features. https://developer.mozilla.org/docs/Web/HTTP label Dec 10, 2024
@github-actions github-actions bot added the size:xs [PR only] 0-6 LoC changed label Dec 10, 2024
"version_added": "50"
"version_added": "50",
"impl_url": "https://bugzil.la/1591932",
"notes": "Since version 72, Content Type sniffing is enabled on top-level documents that have no `Content-Type`, even when `X-Content-Type-Options: nosniff` is set."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In other words: Firefox ignores the X-Content-Type-Options header if the response has no Content-Type header?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you should be setting a Content-Type if you're saying X-Content-Type-Options: nosniff.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this be accurate and easier to understand?

Suggested change
"notes": "Since version 72, Content Type sniffing is enabled on top-level documents that have no `Content-Type`, even when `X-Content-Type-Options: nosniff` is set."
"notes": "Firefox 72 and later ignores the header on top-level documents that have no `Content-Type` set."

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, after digging, this was reverted in Fx 75, https://bugzilla.mozilla.org/show_bug.cgi?id=1594766

So from 75 onwards, it's as follows:

/*
* If we did not get a useful Content-Type from the server
* but also have sniffing disabled, just determine whether
* to use text/plain or octetstream and log an error to the Console
*/

So X-Content-Type-Options: nosniff is respected.

See https://web.archive.org/web/20200410215516/https://blog.mozilla.org/security/2020/04/07/firefox-75-will-respect-nosniff-for-page-loads/

I think we can close this as there's nothing really useful to add here.

@bsmth bsmth changed the title Firefox 72 allows for MIME sniffing on top-level documents when no Content Type is set (outdated) Firefox 72 allows for MIME sniffing on top-level documents when no Content Type is set Dec 12, 2024
@bsmth bsmth closed this Dec 12, 2024
@bsmth bsmth deleted the http-impl-urls-2 branch December 12, 2024 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:http Compat data for HTTP features. https://developer.mozilla.org/docs/Web/HTTP size:xs [PR only] 0-6 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants