Anti-XSS exception regex hangs Firefox

Bug reports and enhancement requests
Post Reply
jordon
Posts: 1
Joined: Fri Feb 04, 2011 11:41 pm

Anti-XSS exception regex hangs Firefox

Post by jordon »

I'm not sure if this counts as a bug since it requires the user to write a (probably pretty bad) regular expression.

Tested on Ubuntu 10.10, Firefox 3.6.13, and NoScript 2.0.9.7 and 2.0.9.8rc1. This seems to have happened for the past few versions as well. You need a Facebook account to verify this, but it might happen on other sites too.

1. Create a new profile and install NoScript.
2. Add the following Anti-XSS exception rule: ^https://(.+\.)+ufl\.edu/
3. Allow scripts from facebook.com and fbcdn.net.
4. Go to facebook.com and log in.
5. Go to https://www.facebook.com/ (you can enter the address manually or have NoScript force SSL for the site).
6. Firefox stalls and displays the unresponsive script dialog with regards to chrome://noscript/content/RequestWatchdog.js:480.

In the profile I use for day-to-day browsing, the result is worse; Firefox always hangs without even warning about an unresponsive script. I remove that particular regex, and everything is fine.

So, maybe this isn't a bug - I understand that operations involving regexes can be costly, and this one that I wrote could probably be more specific - but it's only been happening for the past few versions of NoScript.
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101206 Ubuntu/10.10 (maverick) Firefox/3.6.13
User avatar
Giorgio Maone
Site Admin
Posts: 9527
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: Anti-XSS exception regex hangs Firefox

Post by Giorgio Maone »

XSS exception handling has not been changed in a VERY long time, so I doubt "a few" version ago things were different.
If anything really changed, I would be more inclined to look at Firefox's regexp implementation.

However, it's well known that badly written regexps can turn into even infinite or pseudo-infinite loops, so you're correct in saying this is not a NoScript bug.

If I understand your intent correctly, the following is both more specific and safer (yours would match
https://some-completely-unrelated.website.com/some/path/ufl.edu/some/other/gibberish
for instance):

Code: Select all

^https://[^/]+\.ufl\.edu/
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13
Post Reply