-
Notifications
You must be signed in to change notification settings - Fork 474
Blocking Cross-site scripts (XSS) #276
Comments
Block 3rd-party sites by default, i.e. work in default-deny mode. uMatrix with out-of-the-box setting protects you. since only passive 3rd-party content is allowed (css, images). |
Sometimes: "Furthermore, NoScript's sophisticated InjectionChecker engine checks also all the requests started from whitelisted origins for suspicious patterns landing on different trusted sites: ..." So if you allow a script from a 3rd party site (trusted) which is later compromised, noscript claims be likely to detect that. Also, if the malicious script is entirely embedded within the 1st party site (is this technically xss?), then noscript can be configured to detect that by setting noscript.injectionCheck to "check every request*. Plugins that try to do too much screw over users when they become partially obsolete. I wish noscript's "InjectionChecker" engine would be repackaged as a standalone extension. Kinda uncertain regarding umatrix'es unrelated settings (strict https, spoof user agent, clear browser cache, delete non-blocked session cookies). Anyway noscript can be run in "allow scripts globally mode" to access its ancillary features such as XSS/CSRF protection. edit: actually, I don't think noscript's ABE provides any additional CSRF protection over umatrix, if you properly block the correct xhr 3rd parties. |
If you're going to use NoScript and µMatrix together, then you might want to consider setting NoScript to ‘Cascade top-level document's permissions to third-party sites’. |
If umatrix is used with noscript in "allow scripts globally mode", then "cascade top-level document's permissions to third-party sites" has no effect, I presume? |
Correct. Allowing scripts globally makes most of the other script settings redundant. However, cascading permissions might be a better choice when combining with uMatrix. Then, NoScript will control the permissions of the top-level site (including inline scripts), and once it's allowed, uMatrix will control all the third parties. |
What is the advantage of NoScript's "cascading permissions" over adding the global rule ... then allowing on a per-site basis all non-blacklisted scripts (1st- and 3rd-party ones) with two clicks to toggle the ... ? |
Does that cover inline scripts? If so, it's pretty close. I believe uMatrix doesn't handle data: URIs, though? PoC at http://evil.hackademix.net/hsb/ Also, NoScript has the option to distinguish protocols (eg only allowing the HTTPS version of a site to run scripts). |
that page pwnd me with noscript set to allow all scripts and ublock and umatrix blocking scripts D: |
this is all the logger shows:
it reports that the inline script was blocked but it still works |
is the source. you dont even see it with even with |
i just found out about |
"So if you allow a script from a 3rd party site (trusted) which is later compromised, noscript claims be likely to detect that." Well, it depends on what kind of "compromise" you mean. That's not really what XSS is about. The much more likely scenario is: you trust uMatrix has a very good chance of catching the attack, too, because why would you have allowed "Also, if the malicious script is entirely embedded within the 1st party site (is this technically xss?)" Certainly it is. It's called Persistent XSS, aka type 2 (I think), and it's quite nasty (Samy worm anyone?). Typically happens on sites like wikis or forums (or Github?) that store and display snippets of user-provided content. NoScript can't catch it directly, since the crafted request happened earlier in the attacker's session. However, such attacks typically have limited space, so they rely on pulling down payloads from other sites. Which will probably not be trusted, so the attack would fail. "I wish noscript's "InjectionChecker" engine would be repackaged as a standalone extension." Well, it's GPL-licensed, so feel free...although there is an advantage to incorporating it within NoScript itself. Putting every request through InjectionChecker has overheads. NoScript reduces this by applying a simpler and harsher check to requests originated by untrusted sites. |
Does uMatrix block XSS like NoScript does?
If not, is it possible to add this feature, or is this even needed at all?
The text was updated successfully, but these errors were encountered: