DEV Community

Cover image for Beware the Forgotten Tab: Understanding and Preventing Tabsnabbing
Nicolás
Nicolás

Posted on

Beware the Forgotten Tab: Understanding and Preventing Tabsnabbing

If you’re anything like me, your curiosity tends to get the better of you. You start reading a blog post, click on a related article (or two… or ten), and before you know it, your browser looks like a chaotic battlefield of open tabs.

This kind of tab-hopping often comes from our multitasking instincts — reading a bit here, jumping there, chasing the next interesting thing that catches our eye. Before long, you’ve gone so far down the rabbit hole that you’re learning how nut prices in Asia affect global trade, even though all you wanted to know in the first place was whether it’s going to be sunny tomorrow.

Now, having too many tabs open isn’t really a problem — at least, not if your computer can handle it. But what if I told you that, somewhere in that ocean of forgotten tabs, something darker might be waiting? Something that could turn against you the moment you let your guard down?

Welcome, my friend, to Tabsnabbing — a sneaky phishing technique that exploits your trust in your own open tabs.

What Is Tabsnabbing?

Tabsnabbing is a type of phishing attack that leverages inactive browser tabs. When a user navigates away from a page but leaves its tab open, a malicious site can detect that state and replace its content with a realistic-looking login page (for example Gmail, GitHub, or an online bank). If the user returns and enters their credentials, the attacker captures them.

Tabsnabbing Types

There exist two types of tabsnabbing:

  • Passive (the most common)
    This is the one that changes the original content of the website, when the tab is inactive, for a login page. When you return to it, it gives the impression that the session expired, so the user is more likely to enter their credentials.

  • Reverse
    This one occurs when you click on a link that opens a new browser tab. Unknowingly, this action triggers a process that automatically change the content of previous page.

Why It Works So Well

Tabsnabbing preys on two simple things:

  • Trust
    You think the tab is still the site you opened earlier (e.g., “That’s my Gmail tab, right?”).

  • Distraction
    We multitask. We leave tabs open for hours. Sometimes days.

The combination means that when you return to a tab and see a login page, your brain fills in the blanks: “I must’ve been logged out.” And that’s when the attacker wins.

What Risks We Face

  • Identity Theft
    Attackers can pretend they are you if they manage to your credentials for email account, your social accounts (TikTok, Instagram, Facebook...)

  • Financial Loss
    Capturing your bank credentials can lead to attackers transfering money out your account, using your card details to purchase goods

  • Access to sensitive information
    Company's proprietary data if your work credentials are captured, your medical records...

How to Protect Yourself

  • Close tabs you are not using
  • Verify the URL before entering credentials. If in doubt, close the tab and navigate to the login page.
  • Don't reuse passwords
  • Enable MFA whenever possible

Final Thoughts

Tabsnabbing is one of those web security gotchas that’s easy to underestimate. It doesn’t rely on zero-days or fancy exploits — just our everyday browsing habits.

It’s a good reminder that security is as much about psychology as it is about code.

Top comments (0)