Skip to main content
ContentMedium PriorityFree

Reverse Tabnabbing Protection

Updated November 2026·SecScanner Team

Reverse tabnabbing is an attack where a page opened via target="_blank" can hijack the original tab using the window.opener API.

28% of the 99 most-visited sites we scan fail this check. See the full data.

Results in 1–3 minutes · Free · No signup required

Why It Matters

Without rel="noopener", a malicious page opened in a new tab can redirect the original tab to a phishing page. Users may not notice the change and enter credentials on the fake page.

How We Check

We scan all anchor tags with target="_blank" and verify they include rel="noopener" or rel="noreferrer" attributes.

Good vs Bad Values

Good and bad values for Reverse Tabnabbing Protection
ValueVerdictWhy
<a href="https://partner.example" target="_blank" rel="noopener noreferrer">GoodBoth tokens present. The new page gets no window.opener and no Referer header.
<a href="…" target="_blank" rel="noopener">GoodEnough to cut window.opener. The Referer header is still sent, which is usually acceptable.
<a href="…" target="_blank" rel="noreferrer">Goodnoreferrer implies noopener in the specification, so the check accepts it.
<a href="https://example.org" target="_blank">BadNo rel at all. Current browsers add noopener implicitly, but older and embedded browsers do not, and the check reports every such link.
<a href="…" target="_blank" rel="nofollow">Badnofollow is an SEO hint and says nothing about window.opener. The link is still unprotected.
<a href="/docs/guide" target="_blank">BadA same-site link is reported too, because the check looks at every target="_blank" anchor with a real href. Same-site pages are trusted, so this one is low risk but easy to fix.
<a href="mailto:hi@example.com" target="_blank"> or href="#section"GoodSkipped: anchors, mailto:, tel: and javascript: links open no foreign page.
window.open(url) in a click handler with no noopener featureWeakNot an anchor, so this check cannot see it, but the same attack applies. Pass 'noopener,noreferrer' as the third argument.

How to Fix

Add rel="noopener noreferrer" to all links with target="_blank". Modern browsers add noopener by default for target="_blank", but explicit attributes ensure protection in older browsers.

Find every instance in a codebase or a database export:

grep -rn 'target="_blank"' --include='*.html' --include='*.php' --include='*.tsx' --include='*.vue' . | grep -v noopener

Plain HTML — the one correct form:

<a href="https://partner.example" target="_blank" rel="noopener noreferrer">Partner</a>

React / Next.js — enforce it at lint time so it cannot come back:

{
  "rules": {
    "react/jsx-no-target-blank": ["error", { "allowReferrer": false }]
  }
}

In next/link, pass target="_blank" rel="noopener noreferrer" to the component; it forwards them to the anchor.

WordPress — the block editor adds noopener when you toggle the new-tab option, but classic content and page-builder widgets may not. A server-side filter can add it to stored posts:

add_filter('the_content', function ($html) {
    return preg_replace_callback('/<a\s[^>]*target=["\']_blank["\'][^>]*>/i', function ($m) {
        return stripos($m[0], 'rel=') === false
            ? str_replace('target=', 'rel="noopener noreferrer" target=', $m[0])
            : $m[0];
    }, $html);
});

Scripted navigation — use the window features string:

window.open(url, '_blank', 'noopener,noreferrer');

There is no server directive that fixes this, because the attribute lives in the markup. Verify by viewing the page source and checking that every target="_blank" anchor in the output (not in your templates) has a rel attribute.

Common Mistakes

  • Relying on browser defaults. Implicit noopener is real in current browsers, but a report that must hold for every visitor, embedded web view and reader app should not depend on it.
  • Adding rel only to links you consider external. A user-generated link, a CMS editor field or a markdown renderer produces target="_blank" with no rel, and those are the dangerous ones.
  • Replacing the whole rel value in a script. Code that sets el.rel = 'nofollow' overwrites a noopener that was present in the markup.
  • Using rel="nofollow" or rel="external" as if it did the same job. Neither affects window.opener.
  • Fixing the templates but not the content stored in the database, such as old blog posts and widget HTML that still carry bare target="_blank".

Frequently Asked Questions

What is Reverse Tabnabbing Protection?

Reverse tabnabbing is an attack where a page opened via target="_blank" can hijack the original tab using the window.opener API.

Why does Reverse Tabnabbing Protection matter for website security?

Without rel="noopener", a malicious page opened in a new tab can redirect the original tab to a phishing page. Users may not notice the change and enter credentials on the fake page.

How do I fix Reverse Tabnabbing Protection issues?

Add rel="noopener noreferrer" to all links with target="_blank". Modern browsers add noopener by default for target="_blank", but explicit attributes ensure protection in older browsers.

Related Security Checks

Check Your Website Now

Run a free security scan to check for Reverse Tabnabbing Protection issues and 61 other security checks.

Scan Your Website Free