-
Notifications
You must be signed in to change notification settings - Fork 1.8k
JS: change the precision of the js/unsafe-external-link
query to low
#16002
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
Conversation
QHelp previews: javascript/ql/src/DOM/TargetBlank.qhelpPotentially unsafe external linkHTML links that open in a new tab or window allow the target page to access the DOM of the origin page using Note that only older browsers, where RecommendationSpecify the link type by adding an attribute ExampleIn the following example, a JSX element is created that corresponds to an HTML link opening the URL var link = <a href="http://example.com" target="_blank">Example</a>; To fix this vulnerability, add a var link = <a href="http://example.com" target="_blank" rel="noopener noreferrer">Example</a>; References
|
javascript/ql/src/change-notes/2024-03-21-target-blank-precision.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Asger F <asgerf@github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks!
Note that only older browsers, where <code>target="_blank"</code> does not imply <code>rel="noopener"</code>, | ||
are affected by this vulnerability. Modern browsers implicitly add <code>rel="noopener"</code> to | ||
<code>target="_blank"</code> links. | ||
Refer to the <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#browser_compatibility">browser compatibility section |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: is it worth specifying that this hyperlink is going to the MDN docs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. I don't think that's needed here. But thanks.
Fixes #15995