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

Important security consideration for using target="_blank" #413

Closed
stackola opened this issue Apr 13, 2020 · 6 comments
Closed

Important security consideration for using target="_blank" #413

stackola opened this issue Apr 13, 2020 · 6 comments
Labels
👀 no/external This makes more sense somewhere else

Comments

@stackola
Copy link

stackola commented Apr 13, 2020

Using target="_blank" on hyperlinks without using rel="noopener" is a problem, because the opened page can access and modify some properties on the opening page.

You can find out more information here:

https://www.jitbit.com/alexblog/256-targetblank---the-most-underestimated-vulnerability-ever/

Proposed fix

Automatically add rel="noopener noreferrer" to all links that are targeting _blank, or make rel user-accessible like target

@fdidron
Copy link

fdidron commented Apr 30, 2020

Hello, I created PR #418 for this, I went with adding a linkRel prop instead of automagically adding rel="noopener noreferrer".

Needed this for https://configure.ergodox-ez.com/ :)

@fdidron
Copy link

fdidron commented Apr 30, 2020

Doh there was already an opened PR #350

@ChristianMurphy
Copy link
Member

This can also be added through a plugin using https://github.com/remarkjs/remark-external-links

@wchargin
Copy link

Also in the same boat; I actually tried the workaround suggested by
@ChristianMurphy, but wasn’t able to get it to work (found this thread
by searching for remark-external-links). Cf. #188.

@tomchen
Copy link

tomchen commented Jul 10, 2020

Very important security fix, hope either #350 or #418 can be merged very soon.

Actually when linkTarget is set to _blank, linkRel should default to noopener noreferrer instead of the initial default undefined, although it would complicate the settings a little bit.

@wooorm
Copy link
Member

wooorm commented Oct 8, 2020

The suggested solution is the plugin mentioned above; there will be a release soon which fixes support for plugins

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👀 no/external This makes more sense somewhere else
Development

No branches or pull requests

6 participants