[RESOLVED] XSS whitelisting

Ask for help about NoScript, no registration needed to post
Gazer75

[RESOLVED] XSS whitelisting

Post by Gazer75 »

Please make a simple way to white list for XSS. The regular expression cr*p is confusing. Been trying for months to figure out how to use it, not just for this, and not getting anywhere.
Why cant this list be a simple website list?

Can someone help me fix www.se.no/tv/ so I can use my tv guide again?

Thank you
Last edited by Tom T. on Wed Mar 28, 2012 3:05 am, edited 2 times in total.
Reason: make a little more family-friendly
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20100101 Firefox/11.0
Tom T.
Field Marshal
Posts: 3620
Joined: Fri Mar 20, 2009 6:58 am

Re: XSS whitelisting

Post by Tom T. »

Gazer75 wrote:Please make a simple way to white list for XSS. The regular expression cr*p is confusing. Been trying for months to figure out how to use it, not just for this, and not getting anywhere.
Why cant this list be a simple website list?
Probably because the detection and prevention of the various types of XSS, and the minimization of false positives, is more complex than simply whitelisting a script or site, though I could be mistaken.

As a quick-and-dirty work-around, this made the XSS notification go away for me:

Code: Select all

^https?://konto\.dagbladet\.no/.*
although since Javascript injection is in fact being reported, I'd rather have Giorgio look at this and see if it's a false positive or something genuinely amiss.

Ahh -- going further, a pop-up opens, asking for login creds, and that pop-up has a blocked object that requires further permission.

Code: Select all

Temporarily allow http://www.se.no/xdr/xd_receiver.html#fname=clientLogin$namespace=DB.Client
(text/html <IFRAME> / https://konto.dagbladet.no)
So yes, iFrame injection or similar appears to be going on. But everything else works, including all of the links.

Confirmed as also successfully removing the XSS notification on Fx 11.0 as well as 3.6.28.

I'll let him know. Please confirm that the work-around works in the meantime.

"The Big Bang Theory" is popular there? :)

@ Giorgio:

Code: Select all

[NoScript InjectionChecker] JavaScript Injection in ///api/xdr/dev/#host=www.se.no$xdr=xdr/xd_receiver.html$sf=checkServerLogin
(function anonymous() {host = www.se.no$xdr = xdr;DUMMY_EXPR;})

[NoScript XSS] Sanitized suspicious request. Original URL [https://konto.dagbladet.no/api/xdr/dev/#host=www.se.no$xdr=xdr/xd_receiver.html$sf=checkServerLogin] requested from [http://www.se.no/tv/#]. Sanitized URL: [https://konto.dagbladet.no/api/xdr/dev/#6425552468366076828].
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.28) Gecko/20120306 Firefox/3.6.28
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: XSS whitelisting

Post by Giorgio Maone »

It is a false positive, indeed, caused by the weird hash parameters convention which overlaps with JavaScript syntax.
I'll try to "desensitize" the InjectionChecker module to this pattern in a future version.

In the meanwhile, thanks Tom T. for the suggested work-around, which can further be tweaked this way to be more specific:

Code: Select all

^https?://konto\.dagbladet\.no/[^<"']+#
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20100101 Firefox/11.0
Gazer75

Re: XSS whitelisting

Post by Gazer75 »

Thank you!

I love NoScript, but sometimes it makes me scratch my head :)

Sorry if the language was a bit harsh. Regex really makes me angry as I can't seem to figure out out it works...
Any good sites that can teach me?
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20100101 Firefox/11.0
User avatar
therube
Ambassador
Posts: 7969
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

Re: XSS whitelisting

Post by therube »

Good or bad, don't know, but ... Wikipedia: Regular expression.
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 NT 6.1; WOW64; rv:13.0) Gecko/20120327 Firefox/13.0a2 SeaMonkey/2.10a2
Tom T.
Field Marshal
Posts: 3620
Joined: Fri Mar 20, 2009 6:58 am

Re: XSS whitelisting

Post by Tom T. »

@ Gazer75:
therube wrote:Good or bad, don't know, but ... Wikipedia: Regular expression.
It's good, but to avoid information overload, I'd suggest focusing on "Basic Concepts", "Syntax", and "Posix" (including all subsections).
Else, it becomes overwhelming for the novice.

Perhaps let the webmaster know of the issue, and of Giorgio's recommendation to modify their syntax? Link to this thread...

@ Giorgio:
Thanks for the confirmation as false positive, the possible future tweak of InjectionChecker (can't anyone tell these sites not to use parameters that may collide with JS?), and the fine-tuning. It was near the end of my session, and I wanted to give OP *something* that would work while it was still fairly early in the indicated region's day. :)

Will mark as Resolved, thanks.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.28) Gecko/20120306 Firefox/3.6.28
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: [RESOLVED] XSS whitelisting

Post by Giorgio Maone »

Please check latest development build 2.3.7rc1: it should work even without exceptions.
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20100101 Firefox/11.0
Tom T.
Field Marshal
Posts: 3620
Joined: Fri Mar 20, 2009 6:58 am

Re: [RESOLVED] XSS whitelisting

Post by Tom T. »

Giorgio Maone wrote:Please check latest development build 2.3.7rc1: it should work even without exceptions.
Confirmed that with NS 2.3.7rc1, the site works all the way through the loading of the pop-up login box, with no XSS messages, nothing pertinent in Error Console, and with zero XSS exceptions, in both Fx 11.0 and (what's left of) Fx 3.6.28, thanks.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.28) Gecko/20120306 Firefox/3.6.28
dhouwn
Bug Buster
Posts: 968
Joined: Thu Mar 19, 2009 12:51 pm

Re: [RESOLVED] XSS whitelisting

Post by dhouwn »

Considering regular expressions, http://perldoc.perl.org/perlre.html and https://developer.mozilla.org/en/JavaSc ... on_Pattern look like quite good summaries (in former you just need to ignore all the Perl-specific stuff).
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20100101 Firefox/11.0
Tom T.
Field Marshal
Posts: 3620
Joined: Fri Mar 20, 2009 6:58 am

Re: [RESOLVED] XSS whitelisting

Post by Tom T. »

dhouwn wrote:Considering regular expressions, http://perldoc.perl.org/perlre.html <snip> ignore all the Perl-specific stuff).
Consult a Perl guide, but ignore all Perl-specific stuff? ;)

Can't argue with the MDN link, but as the name implies, it's targeted to developers (presupposing a good bit of knowledge and experience). WP article seems more targeted to a lay audience, but it's OP's call.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.28) Gecko/20120306 Firefox/3.6.28
Post Reply