fix: add rel='noopener noreferrer' to external links#729
Open
Pranav-IIITM wants to merge 1 commit into
Open
Conversation
Adds rel='noopener noreferrer' to all target='_blank' links across the site's layout partials to improve security and performance. Signed-off-by: Pranav-IIITM <jogdandpranav2007@gmail.com>
Author
|
@zyyw @OrlinVasilev @AllForNothing Please review the PR !! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
All external links using
target="_blank"across the site's partials were missing therel="noopener noreferrer"attribute, exposing the site to reverse tabnapping attacks and minor performance issues. This PR fixes all affected files.Closes #726
Changes Made
Added
rel="noopener noreferrer"to alltarget="_blank"links in the following files:layouts/partials/social-buttons.html— GitHub, Twitter, Slack linkslayouts/partials/navbar.html— External top menu linkslayouts/partials/home/hero.html— Download releases buttonlayouts/partials/home/project.html— Community linklayouts/partials/footer.html— GitHub, Status Page, Logos, Slack, Twitter, CC-BY-4.0 License, The Linux Foundation, Trademark Usage linkslayouts/partials/docs/sidebar.html— GitHub source & issues linkslayouts/partials/cli-docs/sidebar.html— GitHub source & issues linkslayouts/partials/blog/posts.html— External blog linksBefore & After
Before
After
Why It Matters
window.openerand redirect the original page to a malicious URLnoreferrerstops the browser from sending theRefererheader, preventing the origin URL from leaking to external sitesnoopenerensures the new tab runs in a separate process, improving performance in some browsersReferences
Checklist
target="_blank"links now includerel="noopener noreferrer"