{"data":{"slug":"github-thedaviddias-front-end-checklist-skills-new-tab-0833c639fae9","title":"Ensure External Links Open in New Tabs Safely","summary":"Verify that all external links opening in new tabs include the 'rel=\"noopener noreferrer\"' attribute to prevent security vulnerabilities such as reverse tabnapping.","url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-new-tab-0833c639fae9","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-thedaviddias-front-end-checklist-skills-new-tab-0833c639fae9","markdown_url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-new-tab-0833c639fae9.md","download_url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-new-tab-0833c639fae9\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Ensure that the codebase uses a modern browser-compatible environment, as older browsers require explicit 'rel=\"noopener noreferrer\"' attributes. Consider configuring ESLint rules like 'jsx-a11y\/anchor-is-valid' and 'eslint-plugin-security' to enforce this automatically.","instructions":"---\nname: new-tab\ndescription: \"Use when reviewing HTML or JSX for anchor elements with target='_blank' to verify rel='noopener noreferrer' is present.\"\nmetadata:\n  category: security\n  priority: medium\n  difficulty: beginner\n  estimatedTime: \"10\"\n  source: frontendchecklist.io\n  url: https:\/\/frontendchecklist.io\/rules\/security\/new-tab\n---\n\n# External Link Security\n\nA malicious site opened via target='_blank' can use window.opener.location to silently redirect your original tab to a phishing page \u2014 the user switches back and sees a fake login screen on what appears to be your domain.\n\n## Quick Reference\n\n- Always add `rel=\"noopener noreferrer\"` to any `<a target=\"_blank\">` link\n- `noopener` prevents the new tab from accessing `window.opener` and redirecting your page\n- `noreferrer` additionally suppresses the `Referer` header sent to the destination site\n- Modern browsers (Chrome 88+, Firefox 79+) implicitly add `noopener` for cross-origin `_blank` links, but explicit markup is required for older browsers and same-origin links\n- ESLint rule `jsx-a11y\/anchor-is-valid` and `eslint-plugin-security` can enforce this automatically\n\n## Check\n\nFind all anchor elements with target='_blank' in the HTML and JSX source. Verify each one includes rel='noopener noreferrer' (or at minimum rel='noopener'). Flag any external links opening in a new tab that are missing this attribute.\n\n## Fix\n\nAdd rel='noopener noreferrer' to all <a target='_blank'> elements. In React\/JSX this is rel=\"noopener noreferrer\". Configure an ESLint rule to prevent this from recurring.\n\n## Explain\n\nExplain the reverse tabnapping attack enabled by window.opener, how rel='noopener' and rel='noreferrer' prevent it, and the difference between the two values.\n\n## Code Review\n\nReview server config, headers, forms, and integration points related to External Link Security. Flag exact responses, cookies, or browser behaviors that violate the rule, and verify them against the effective production-like response.\n\n---\n\nFor full implementation details, code examples, and framework-specific guidance,\nsee `references\/rule.md`.\n\nRule page: https:\/\/frontendchecklist.io\/rules\/security\/new-tab\n","use_cases":["Reviewing HTML or JSX for anchor elements with target='_blank' to ensure they have rel='noopener noreferrer'.","Auditing legacy code for missing security attributes in external links."],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/thedaviddias\/Front-End-Checklist\/blob\/e8d14d049010e2ce25afcd5e8609dfcbbe63e47e\/skills\/new-tab\/SKILL.md","source_commit":"e8d14d049010e2ce25afcd5e8609dfcbbe63e47e","license":null,"version":null,"listing_approved_at":"2026-11-23","created_at":"2026-11-22T17:10:30.000000Z","updated_at":"2026-11-23T04:55:59.000000Z","seo_title":"Ensure External Links Open in New Tabs Safely","seo_description":"Prevent security vulnerabilities by verifying that all external links opening in new tabs include the 'rel=\"noopener noreferrer\"' attribute.","seo_keywords":["external link security","noopener noreferrer check","HTML anchor tag security","JSX new tab security"]}}