publiclab / plots2

a collaborative knowledge-exchange platform in Rails; we welcome first-time contributors! :balloon:
https://publiclab.org
GNU General Public License v3.0
956 stars 1.83k forks source link

Links to cross-origin destinations are unsafe #7410

Open vinitshahdeo opened 4 years ago

vinitshahdeo commented 4 years ago
<a class="nav-link" target="_blank" href="//store.publiclab.org" >

When you link to a page on another site using the target="_blank" attribute, you can expose your site to performance and security issues:

Adding rel="noopener" or rel="noreferrer" to your target="_blank" links avoids these issues.

noreferrer: It is used to Specify that the browser should not send an HTTP referer header if the user follows the hyperlink.

sakshi-2412 commented 2 years ago

I would like to work on this issue. This should be done for every link tag with target="_blank" attribute right?

sakshi-2412 commented 2 years ago

@govindgoel can you confirm please. Thanks!

govindgoel commented 2 years ago

@sakshi-2412 I think we can check if it is done before or not else work on this. Thanks

sakshi-2412 commented 2 years ago

Yes I checked, and rel="noreferrer" is not added for almost all of the link tags with target="_blank" attribute. I'll make a PR soon. Thanks ✨