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

jsx-no-target-blank does not accept noopener keyword #2983

Closed
meeq opened this issue May 7, 2021 · 1 comment
Closed

jsx-no-target-blank does not accept noopener keyword #2983

meeq opened this issue May 7, 2021 · 1 comment

Comments

@meeq
Copy link

meeq commented May 7, 2021

The rule enforces noreferrer, but it should also accept noopener.

As per the HTML Living Standard on Links (§4.6.6.13 Link type "noopener"):

The [noopener] keyword indicates that any newly created top-level browsing context which results from following the hyperlink will not be an auxiliary browsing context. E.g., its window.opener attribute will be null.

[noreferrer] indicates that no referrer information is to be leaked when following the link and also implies the noopener keyword behavior under the same conditions.

As per the OWASP Cheatsheet on Reverse Tabnabbing:

To summarize, it's the capacity to act on parent page's content or location from a newly opened page via the back link exposed by the opener JavaScript object instance.

To cut this back link, add the attribute rel="noopener" on the tag used to create the link from the parent page to the child page.

While OWASP does suggest also adding noreferrer, there are legitimate scenarios where sending the referrer is intended.

The purpose of this rule is to mitigate a security risk. If the maintainers wish to provide a means to enforce noreferrer, there should be an option or a separate rule.

@meeq meeq changed the title jsx-no-target-blank does not respect noopener keyword jsx-no-target-blank does not accept noopener keyword May 7, 2021
@ljharb
Copy link
Member

ljharb commented May 8, 2021

Duplicate of #2924. Fixed in #2925.

@ljharb ljharb closed this as completed May 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants