Add noopener and noreferrer to external URLs #435
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds
rel="noopener noreferrer"
to external URLs. Technicallynoopener
is not needed for newer browsers, because they set it automatically whentarget="_blank"
, but to me it still seems like a nice thing to not send the referrer along.If the opener is sent along it could potentially also be used in a destructive way. Ignition previously had a RCE vulnerability, if any of the external links contain malicious JS, combined with an RCE it could lead to some bad things. If I'm not mistaken Ignition still has the ability to adjust code (solutions), so IMHO applying these anchor attributes would be good security-wise. Better safe than sorry :)
https://mathiasbynens.github.io/rel-noopener/
Accompanying PR for ignition-ui: spatie/ignition-ui#17