Closed Bug 1235872 Opened 8 years ago Closed 7 years ago

Consider not accepting <script> served as text/csv across origins

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1299267

People

(Reporter: ehsan.akhgari, Unassigned)

Details

(Keywords: sec-want)

See bug 1232785 which was an exploit against bugzilla.mozilla.org.

I think we should consider rejecting text/csv served scripts in <script> tags because other websites may be similarly vulnerable.  Such websites will already be broken in Chrome.  We can consider sending a telemetry ping when we encounter such scripts.

Boris, smaug, what do you think?
Flags: needinfo?
Flags: needinfo?
I'm not suggesting that we should implement X-Content-Type-Options in this bug.
Summary: Consider not accepting <script> served as text/csv → Consider not accepting <script> served as text/csv across origins
Group: core-security → dom-core-security
Feels like a hack to me. What other types should we also reject interpreting as js?

But https://bugzilla.mozilla.org/show_bug.cgi?id=1232785#c77 hints that Chrome is doing something very un-spec'ed. Do we know what exactly? Should it be spec'ed and then implemented everywhere.
But shouldn't CSP have something for this?
I guess I'm thinking something like script-owner which would require certain domain to be the loader, similar-ish to frame-ancestor or using X-Frame-Options
In our original CSP proposal we wanted using CSP to be an opt-in to strict MIME type checking for script (at least), but that was rejected :-(

text/csv isn't the only problem: csv is often served as text/plain or maybe application/octet-stream (I know I've been forced to download them before). I'd love to fix this, but knocking off only text/csv seems way too narrow. on the other hand blocking text/plain would break a bunch I'm sure.

The bugzilla bug isn't hidden anymore, we don't need this discussion to be private.
Group: dom-core-security
Keywords: sec-want
Should we just do what Chrome does, for now?

Gerv
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
Note that we have bug 1333995 to block other MIME types than text/csv.
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.