Skip to content
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

All links should include rel="noopener noreferrer" #569

Closed
tbarbugli opened this issue Oct 12, 2020 · 0 comments
Closed

All links should include rel="noopener noreferrer" #569

tbarbugli opened this issue Oct 12, 2020 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@tbarbugli
Copy link
Member

tbarbugli commented Oct 12, 2020

Links are converted to HTML anchor tags.

For example doyensec.com is converted to doyensec.com. As no rel attribute is present, it is possible for the website opened in the new tab (i.e. doyensec.com) to redirect the opener tab (i.e. bevybevy.com) to an arbitrary location.

Reproduction Steps

  1. Create an HTML file with the following content:
    <script>window.opener.location.href="https://doyensec.com";</script>
  2. Host the HTML file on an HTTP server (i.e. http://attacker.com/exploit.html)
  3. Send in a streaming chat the link to the HTML file (i.e. http://attacker.com/exploit.html)
  4. Click on the link in the chat
  5. Go back to the previous tab
  6. Notice the tab has been redirected to https://doyensec.com

Remediation
Add the rel="noopener" attribute to anchor tags. This attribute prevents "child" tabs to access the window.opener object.

Resources
https://owasp.org/www-community/attacks/Reverse_Tabnabbing
https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types/noopener

gz#6585

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants