Whitelisting XSS

Ask for help about NoScript, no registration needed to post
ronin
Posts: 2
Joined: Tue Jun 24, 2014 1:58 am

Whitelisting XSS

Post by ronin »

I seem to be having issues with white listing sites for XSS. If i want to allow all traffic from a site such as www.foo.com what is the proper rule to place. I don't quite understand the meta characters needed to allow all content from a particular site. I tried to follow a couple of the examples but have to do an unsafe reload almost every time. This is most frustrating that I am tempted to disable completely or use another browser for visiting a particular trusted site that is employing XSS.

Thanks in advance.
Mozilla/5.0 (Windows NT 6.3; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0
barbaz
Senior Member
Posts: 11163
Joined: Sat Aug 03, 2013 5:45 pm

Re: Whitelisting XSS

Post by barbaz »

See the sticky for details.
Basically, it boils down to the fact that you need to know regular expressions to make XSS exceptions. Personally I learned regex from this tutorial. I'll post a couple of basic examples anyway, you can reuse those patterns in the mean time.

If you want to allow all requests originating from a site (I'll use www.foo.com as an example too), you need to make a regular expression which matches "@" followed by its URL. Assuming you trust all other subdomains of foo.com as well as foo.com itself, this would be what you enter in NoScript Options -> Advanced -> XSS -> XSS exceptions:

Code: Select all

^@https?://(?:[^/:]+\.)?foo\.com[^0-9A-Za-z%_\.-]
Otherwise, if you want strict protocol+domain+port matching (recommended wherever possible as stricter is better) - if, say, you want to allow all XSS from "https://www.foo.com" on the default port, you would use

Code: Select all

^@https://www\.foo\.com/
Hope that helps.
*Always* check the changelogs BEFORE updating that important software!
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20121201 icecat/17.0.1
User avatar
Thrawn
Master Bug Buster
Posts: 3106
Joined: Mon Jan 16, 2012 3:46 am
Location: Australia
Contact:

Re: Whitelisting XSS

Post by Thrawn »

The first thing to do is to paste the error console messages here. Giorgio might be able to improve the filter so you don't need the exception.

If the spam filter gets in the way, you can send it to a moderator via private message.
======
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:30.0) Gecko/20100101 Firefox/30.0
ronin
Posts: 2
Joined: Tue Jun 24, 2014 1:58 am

Re: Whitelisting XSS

Post by ronin »

Thanks barbaz, I was close but your example was a great help. If you are missing a critical character it is sometimes difficult to see.
Mozilla/5.0 (Windows NT 6.3; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0
Post Reply