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

add rel="noopener noreferrer" to links for security #6

Merged
merged 1 commit into from
Jun 27, 2020

Conversation

swyxio
Copy link
Contributor

@swyxio swyxio commented Sep 14, 2019

add rel="noopener noreferrer" to links for security

lighthouse caught this, i assume you know what it is already but let me know if a further justificaiton is needed

image

add  rel="noopener noreferrer" to links for security
@rdela
Copy link

rdela commented Oct 30, 2019

I am not using site-kit yet but really this should go in Line 53 rather than line 60 as it is only necessary for target blank. So Line 53:

target_attr = ' target="_blank"';

...would become...

target_attr = ' target="_blank" rel="noopener noreferrer"';

...and line 60 could revert to:

return `<a href="${href}"${target_attr}${title_attr}>${text}</a>`;

I could add the commit if you want to add me as a collaborator on your fork, but probably just as easy to do yourself, your call.

@rdela
Copy link

rdela commented Oct 30, 2019

That said, I question the use of target blank. I see it as part of a hostile user experience pattern that breaks the back button.

Further reading, if so inclined...

Usability:
https://css-tricks.com/use-target_blank/
https://marco.org/2014/01/10/target-blank
https://news.ycombinator.com/item?id=7040661

Security:
https://mathiasbynens.github.io/rel-noopener/
https://www.jitbit.com/alexblog/256-targetblank---the-most-underestimated-vulnerability-ever/

@antony
Copy link
Member

antony commented Apr 11, 2020

@rdela target blank is probably a separate issue and should be raised as such

@Rich-Harris Rich-Harris merged commit 65f100b into sveltejs:master Jun 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants