Skip to content
XSS Disclosed report Intermediate CVE-2025-13013

X-Content-Type-Options is ignored for resources embedded in <object>

Firefox ignores the X-Content-Type-Options: nosniff header for resources embedded in an <object> tag, allowing content sniffing to occur. An attacker could exploit this to achieve XSS on pages that lack a Content-Type header but set nosniff.

Masato Kinugawa Follow

Originally disclosed on Mozilla

  • Fixed in 26 days
  • Paid in 28 days
  • Disclosed after 26 days
Text
Created attachment 9517496
fx_nosniff_bypass_via_object.php

I think `<object>` still has an issue to be fixed apart from the `type` attribute issue I reported as Bug 1979536. Although I mentioned this behavior briefly in Bug 1979536, since the root cause is different, I'll file this as a separate bug.
Normally, Firefox displays resources with `X-Content-Type-Options: nosniff` and no `Content-Type` response header as `text/plain`.
However, when the resource is embedded in an `<object>` tag, `X-Content-Type-Options: nosniff` seems to be ignored and content sniffing occurs.
This may result in XSS occurring on pages where `Content-Type` is not specified even if the `X-Content-Type-Options: nosniff` header is set.
Steps to reproduce:
1. Open this URL: https://vulnerabledoma.in/fx_nosniff_bypass_via_object.php . The resopnse does not have both `X-Content-Type-Options: nosniff` and no `Content-Type` response header.
2. Confirm that the page is displayed as `text/html`, as a result of content sniffing.
3. Open this URL: https://vulnerabledoma.in/fx_nosniff_bypass_via_object.php?nosniff=1 .  The resopnse has `X-Content-Type-Options: nosniff` but no `Content-Type` response header.
4. Confirm that the page is displayed as `text/plain`, as a result of content sniffing being disabled.
5. Open this URL: https://l0.cm/fx_nosniff_bypass_via_object.html . This is a page where the URLs used in step 1 and 3 are embedded in the `<object>`.
6. Confirm that two alert dialogs are displayed (`XCTO: disabled` and `XCTO: enabled`). This means that content sniffing occurred even though `X-Content-Type-Options: nosniff` is specified.

The original report as published on Mozilla's Bugzilla, by Masato Kinugawa. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Impact

This may result in XSS occurring on pages where Content-Type is not specified even if the X-Content-Type-Options: nosniff header is set.

What the attacker needed

Victim uses Firefox; page lacks Content-Type header; page sets nosniff header; attacker can embed resource in <object>

How it was found

  1. Open a URL that returns a response with no Content-Type and no nosniff header.
  2. Confirm the page is displayed as text/html due to content sniffing.
  3. Open a URL that returns a response with nosniff but no Content-Type header.
  4. Confirm the page is displayed as text/plain because sniffing is disabled.
  5. Open a page that embeds both URLs in <object> tags.
  6. Confirm that two alert dialogs appear, showing that sniffing occurred even with nosniff.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

When a web server sends a file, it includes a Content-Type header to tell the browser what kind of file it is. If that header is missing, the browser may guess the type by looking at the file's contents, which is called content sniffing. The nosniff header tells the browser not to guess, but this report shows that Firefox still guesses when the file is loaded inside an <object> element, which could let an attacker run scripts.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More by Masato Kinugawa

View all

26 more disclosed reports, best first.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.