Skip to content

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

Closed
bsmth wants to merge 2 commits intomdn:mainfrom
bsmth:http-impl-urls-2
Closed

(outdated) Firefox 72 allows for MIME sniffing on top-level documents when no Content Type is set#25371
bsmth wants to merge 2 commits intomdn:mainfrom
bsmth:http-impl-urls-2

Conversation

@bsmth
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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