-
-
Notifications
You must be signed in to change notification settings - Fork 669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tabnabbing #1602
Comments
noreferrer - it is separate topic and it is covered in ASVS. noopener - Have you checked and verified it is still an actual issue with modern browsers? Related MDN: |
I cannot find "noopener" nor "noreferrer" in 4.0.3. Is it in 5.0? Is there a generated doc of 5.0 which I can search? |
At caniuse.com, "noopener" and "noreferrer" are well supported. |
With "browser supporting" my point is - did you actually put it to work or you just read it from somewhere? If I remember correctly I tested it and found, that browsers have changed their behavior on the topic, but I'll do the test one more time. Referrer leakage is separate problem from opener and referrer leakage is covered by:
|
Tested just now on chrome Version 111.0.5563.112 64-bit on Windows 10 and found that either noopener or noreferrer defends from tabnabbing. I agree with you that noopener is the logical solution. However I will still advice developers to include rel="noopener noreferrer" in links which specify a target. Perhaps it will help on some obscure browser version! Here's my test code: cwe1022test.html:
cwe1022attack.html:
cwe1022fake.html:
|
I asked
and ..
So, I did. From the issue description:
The (scope)problem with your test:
both values ( So, by default with modern browsers we don't have noopener problem for cross-origin requests. See:
You can open cross-origin opener spreading with https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Opener-Policy |
@securitydave - if there are no other arguments, I'll close this issue (in the future). |
This is great news that compliant browsers may fix this. However, I would still recommend including rel="noopener" on links supplying a non-blank target. Your reference https://mathiasbynens.github.io/rel-noopener/ recommends as such. Now my concern is only whether some still commonly-used browsers may be vulnerable. Your test is convincing for chrome. Thank you. |
There is quite a big difference between recommending and requiring. In ASVS we put requirements which everyone need to follow, it means we don't put "it would be nice if you do this". Only "you need to do this". From current information, I would say it's not worth requirement. For older browsers - an application need to check user's browser and let him/her know if it needs update. Requirement(s) for that are cooking here: #959 |
Decision to make - should we have level3 requirement to cover opener configuration. |
As already stated, I advise including rel="noopener" on links supplying a non-blank target. I think it's a requirement. |
So @securitydave is proposing a new requirement:
In principle modern browsers should fix this but it could be a problem in older browsers. As such, @elarlang is proposing that it should be level 3 early based on the lower likelihood of it being an actual problem. Have I understood everything correctly? |
Recap, just in case. From only
Old browsers problem is covered with:
Other set of conditions - first the likelihood for the problem to happen is close to 0 and second, the attacker need to control resources in the same-origin context where the link points. If those conditions are filled, the opener issue is not your largest problem. Also we should not have many application in the same-origin context (#1299) Like I wrote here: #1602 (comment)
If we going to create new requirement, then I think we should set the wider focus and look for COOP and COEP response headers:
|
2021 is not that long ago, I think we should probably still be recommending something to prevent this. Especially because older browsers might not support COOP/COEP. Can we include both sets of requirements? |
Depends on how many more years 5.0 takes :) but all the arguments were written in my previous comment. |
@elarlang do the COOP and COEP response headers definitely prevent the same thing as the rel=noopener attribute. Should this be one requirement or two? Reading here it felt like it was not exactly the same thing: https://web.dev/why-coop-coep/ |
I don't know the answer right now, need to do "the lab" first. |
Ok so let me know please :) |
Any update @elarlang ? |
Nope. It is low priority task here and it requires some research. |
2021 is ancient in terms of browser version. I agree with @elarlang in that If we going to create new requirement, then I think we should set the wider focus and look for COOP and COEP response headers: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Opener-Policy |
Yes, but only the COOP header is required for this (when set with the proper config). From MDN:
COOP and COEP together permit Cross-Origin Isolation, but that is separate from this discussion. The extent to which browser support COOP and COEP is likely in line with the extent to which they protect against tab nabbing by default. Based on my understanding, I think we can drop this with no action for now. |
@elarlang Recommending closing this issue for these reasons:
If someone looks at this in the future, I think it is worth evaluating whether there are XS-Leak type attacks that are impactful and not sufficiently mitigated by other ASVS requirements. |
+1 Ryan
|
5.3.11 (additional requirement) or 5.6.1 (new section)
Verify that links to external pages which specify a target include rel="noopener noreferrer" to prevent tabnabbing. Tabnabbing is an attack in a linked-to page (not under the application's control) which replaces the linked-from tab in the user's browser with a malicious look-alike page.
CWE-1022
The text was updated successfully, but these errors were encountered: