Skip to content
Access control Write-up Beginner

πŸ”₯ How I Found a Logout Flaw That Kept Sessions Alive β€” A Real-World Bug Bounty Lesson

The logout function did not invalidate the session ID on the server, so a stolen session ID remained valid even after the user logged out. An attacker with a stolen session ID could continue to access the account and perform actions as the victim.

Amitishacked Follow

Published on meetcyber.net

It was just another day in my bug bounty hunting journey. I settled into my chair, opened my laptop, and browsed through a list of potential targets in a disclosure program.

Amitishacked, on meetcyber.net

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the server did not invalidate the session ID upon logout, only removing the cookie from the client.

Impact

An attacker with a stolen session ID could remain logged in indefinitely and perform actions as the victim, even after the victim logs out.

What the attacker needed

Attacker has stolen session ID; victim logs out

The fix

The application should invalidate the session token on the server upon logout, not just remove the client-side cookie.

How it was found

  1. Log in to the test account and copy the session ID from the browser's cookie storage.
  2. Open a fresh Incognito window, manually insert the session ID, and refresh to confirm access.
  3. Log out from the original browser session.
  4. Return to the Incognito window, reinsert the same session ID, and refresh to see if access persists.
  5. Log out from the Incognito session as well.
  6. On a different laptop, open the login page, manually add the same session ID, and refresh to check for access.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

When you log in to a website, the site gives your browser a special code (a session ID) that acts like a temporary key. Normally, when you click 'log out', the website should cancel that key so it cannot be used again. Here, the website did not cancel the key, so anyone who had copied it could still get into the account even after the real user logged out.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by Amitishacked

View all

1 more disclosed report, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.