Running Scripts sent as text/plain

Bug reports and enhancement requests
Post Reply
dhouwn
Bug Buster
Posts: 968
Joined: Thu Mar 19, 2009 12:51 pm

Running Scripts sent as text/plain

Post by dhouwn »

While browsers won't apply stylesheets sent as text/plain (except in quirks mode) they will run scripts sent with this MIME type, would many sites break if they wouldn't?

How about adding the prevention of executing external scripts delivered with the wrong MIME type as an experimental feature to NoScript?
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/533.3 (KHTML, like Gecko) Chrome/5.0.356.2 Safari/533.3
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: Running Scripts sent as text/plain

Post by Giorgio Maone »

Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6
User avatar
therube
Ambassador
Posts: 7969
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

Re: Running Scripts sent as text/plain

Post by therube »

Happened to have Error Console opened & it mentioned:

Code: Select all

Error: The stylesheet http://ibid4216487243.plumd.dnsstuff.com/style.css was not loaded because its MIME type, "text/html", is not "text/css".
Source File: http://www.dnsstuff.com/tools/whois/?ip=
Line: 0
So suppose something like what you suggest is not unheard of.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.9) Gecko/20100317 SeaMonkey/2.0.4
User avatar
therube
Ambassador
Posts: 7969
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

Re: Running Scripts sent as text/plain

Post by therube »

Guess it works then ;-).
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.9) Gecko/20100317 SeaMonkey/2.0.4
dhouwn
Bug Buster
Posts: 968
Joined: Thu Mar 19, 2009 12:51 pm

Re: Running Scripts sent as text/plain

Post by dhouwn »

Hm… interesting, I had something like this in memory, but then this test passed with no mention in the error console.
therube wrote:So suppose something like what you suggest is not unheard of.
That's a stylesheet…
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.3a4pre) Gecko/20100321 Minefield/3.7a4pre
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: Running Scripts sent as text/plain

Post by Giorgio Maone »

dhouwn wrote:Hm… interesting, I had something like this in memory, but then this test passed with no mention in the error console.
Because of the overwhelming false positives which have been found during early test of this feature, NoScript's inclusion type checking has been carefully tuned to cover a limited but very important scenario: the case of a whitelisted CMS-like site which allows uploading of "safe" file types (e.g. zip archives or text documents). This can be exploited, for instance, by an attacker which manages to compromise another whitelisted site injecting a script or stylesheet inclusion which references a "fake" zip from the CMS actually being a Javascript payload, and gets executed because the hosting site is whitelisted.

Therefore the checks are performed only for cross-site inclusion where origin's base domain differs from requested file's, and by default server-side scripts (e.g. ASP or PHP URls) are not checked.

You can see this in action here.
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6
Post Reply