[BUG] Exploiting Anti-XSS Protection Exceptions

Bug reports and enhancement requests
Post Reply
tmj43
Posts: 1
Joined: Tue Feb 11, 2014 2:13 am

[BUG] Exploiting Anti-XSS Protection Exceptions

Post by tmj43 »

Hello all,

I am using Firefox 27.0 and NoScript 2.6.8.13. I have discovered a way to evade the XSS sanitization of NoScript.

NoScript options allows Anti-XSS Protection Exceptions to be set, with one of the defaults being:
^https?://([a-z]+)\.google\.(?:[a-z]{1,3}\.)?[a-z]+/(?:search|custom|\1)\?

Any URL whose beginning matches that regex will be exempt from XSS sanitization. This allows for an exploitation using the @ in a URL. I will use the deliberately insecure website google-gruyere as an example.

http://www.google.com%2Fsearch%3F@google-gruyere.appspot.com/402153350769/<script>alert(1)</script>

This URL will take a you to a website whose URL has not been sanitized, because it matches the regex on the Anti-XSS Protextion Exceptions list. Because the website I chose is insecure, going to that URL will cause JavaScript to be inserted into the page. There are a few things that make an attack based on this difficult, but still plausible. First, a user going to this URL will receive a warning from Firefox saying they might not be going where they intend to. They will be asked if they want to continue. Second, this same attack must used on a trusted website, so the injected JavaScript is allowed to execute.

Although Firefox does warn users that they may be going somewhere they do not intend, naive users will continue to the website, which may execute some malicious JavaScript, even with NoScript installed.
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0
User avatar
Thrawn
Master Bug Buster
Posts: 3106
Joined: Mon Jan 16, 2012 3:46 am
Location: Australia
Contact:

Re: [BUG] Exploiting Anti-XSS Protection Exceptions

Post by Thrawn »

Good spot.

Giorgio, would it be reasonable to change that exception to this?

Code: Select all

^https?://([a-z]+)\.google\.(?:[a-z]{1,3}\.)?[a-z]+/(?:search|custom|\1)\?[^@]*$
ie don't match anything containing an @ symbol after the question mark.
======
Thrawn
------------
Religion is not the opium of the masses. Daily life is the opium of the masses.

True religion, which dares to acknowledge death and challenge the way we live, is an attempt to wake up.
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:27.0) Gecko/20100101 Firefox/27.0
Post Reply