Add protection against absence of rel-noopener
Add protection against absence of rel-noopener
Hi,
Shouldn't NoScript protect from this ?
https://mathiasbynens.github.io/rel-noopener/
It doesn't seem very far from XSS, even if it's technically not (or is it ?). Either way, when scripts are enabled, it would be nice that NoScript still protects against such oddities.
I don't even see how this could be a legitimate feature, especially for the cross-origin demo.
Shouldn't NoScript protect from this ?
https://mathiasbynens.github.io/rel-noopener/
It doesn't seem very far from XSS, even if it's technically not (or is it ?). Either way, when scripts are enabled, it would be nice that NoScript still protects against such oddities.
I don't even see how this could be a legitimate feature, especially for the cross-origin demo.
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0
Re: Add protection against absence of rel-noopener
*Always* check the changelogs BEFORE updating that important software!
-
Re: Add protection against absence of rel-noopener
Oh, didn't see that. Sorry!
Though the point remains in that NoScript keeps XSS protection enabled even when scripts are globally allowed. Here, if the malicious site has JS enabled, it can apparently do phishing attacks on the other tab. As someone who is very used to NoScript, this is the kind of thing I'd expect it to protect from even with JS enabled, so I was surprised when I tried it out.
This is IMO especially worth considering as a feature when you account for the fact that web browser's protection against this attack involve modifying the website, which ain't going to happen everywhere or soon. A passive protection sounds like it is worth adding to the TODO list. Once upon a time, NoScript could pride itself on implementing fixes right away to newly found exploits, too. That's why I was surprised here.
Though the point remains in that NoScript keeps XSS protection enabled even when scripts are globally allowed. Here, if the malicious site has JS enabled, it can apparently do phishing attacks on the other tab. As someone who is very used to NoScript, this is the kind of thing I'd expect it to protect from even with JS enabled, so I was surprised when I tried it out.
This is IMO especially worth considering as a feature when you account for the fact that web browser's protection against this attack involve modifying the website, which ain't going to happen everywhere or soon. A passive protection sounds like it is worth adding to the TODO list. Once upon a time, NoScript could pride itself on implementing fixes right away to newly found exploits, too. That's why I was surprised here.
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0
Re: Add protection against absence of rel-noopener
Well, I wouldn't go that far, as no one ever answered this -
barbaz wrote:NoScript does have background tab refresh protections, which should protect against this, right? So does this "attack" still work with NS enabled if it hijacks the original tab actually to a different page, instead of just a different hash on the same page?
*Always* check the changelogs BEFORE updating that important software!
-
Re: Add protection against absence of rel-noopener
According to the PoC description, that would be a yes.In this proof of concept, malicious.html replaces the tab containing index.html with index.html#hax, which displays a hidden message. This is a relatively harmless example, but instead it could’ve redirected to a phishing page, designed to look like the real index.html, asking for login credentials. The user likely wouldn’t notice this, because the focus is on the malicious page in the new window while the redirect happens in the background.
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0
Re: Add protection against absence of rel-noopener
For the first question in your quote - NoScript doesn't provide protection as long as scripts are allowed on the malicious site.
window.opener is a reference to the previous tab's document or something like that - gives quite a lot of power over it.
window.opener is a reference to the previous tab's document or something like that - gives quite a lot of power over it.
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0
Re: Add protection against absence of rel-noopener
Man I'm sorry for the triple post, but here it is laid out in clear:
TL;DR If window.opener is set, a page can trigger a navigation in the opener regardless of security origin.
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0
Re: Add protection against absence of rel-noopener
OK I looked at what it's doing and put up a test case on my local server. By default, if the attack site's scripts are allowed, NoScript does NOT protect against this attack at all. However, that doesn't mean it can't already do so.
about:config
right-click > new > string
name:
value:
right-click > new > string
name:
value:
about:config
right-click > new > string
name:
Code: Select all
noscript.surrogate.noopener.replacement
Code: Select all
if(window.opener)window.opener=null;
name:
Code: Select all
noscript.surrogate.noopener.sources
Code: Select all
@*
*Always* check the changelogs BEFORE updating that important software!
-
Re: Add protection against absence of rel-noopener
Awesome, it works! I didn't realise surrogates could be used for such built-in functionality as window.opener, but it's obvious now that I see the solution 
Will or should NoScript include this by default ?
I wonder if it breaks stuff on the web, that's why I referred to XSS protection, which works with algorithms rather than crude blocking. I'm personally fine with this solution but I use a very strict NS config so I'm not representative.

Will or should NoScript include this by default ?
I wonder if it breaks stuff on the web, that's why I referred to XSS protection, which works with algorithms rather than crude blocking. I'm personally fine with this solution but I use a very strict NS config so I'm not representative.
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0
Re: Add protection against absence of rel-noopener
No idea. That's up to Giorgio.Tori wrote:Will or should NoScript include this by default ?
If it does, create another string pref namedTori wrote:I wonder if it breaks stuff on the web,
Code: Select all
noscript.surrogate.noopener.exceptions
*Always* check the changelogs BEFORE updating that important software!
-
Re: Add protection against absence of rel-noopener
I'll keep that in mind. Thanks! 

Mozilla/5.0 (Windows NT 6.1; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0
Re: Add protection against absence of rel-noopener
Except, I assume, when you don't whitelist the target of the link.barbaz wrote:By default, NoScript does NOT protect against this attack at all.
======
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.
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:45.0) Gecko/20100101 Firefox/45.0
Re: Add protection against absence of rel-noopener
Yep. I should probably edit that post. Thanks.Thrawn wrote:Except, I assume, when you don't whitelist the target of the link.barbaz wrote:By default, NoScript does NOT protect against this attack at all.
*Always* check the changelogs BEFORE updating that important software!
-