Skip to content
Access control Write-up Intermediate

Insufficient Session Expiration: A Permanent Backdoor into MFA Ac

The application did not invalidate session tokens on logout, so a captured session cookie remained valid server-side. An attacker with that token could regain full authenticated access to the victim's account without credentials or 2FA.

Bavly Zaher Follow

Published on medium.com

The affected platform is a web application that exposes its backend services through an API endpoint hosted on a fictional domain used for disclosure purposes: https://api.target.com/login

Bavly Zaher, on medium.com

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

The logout function only cleared the cookie client-side and did not tell the server to invalidate or blacklist the session record.

Impact

Anyone with the leaked session token could fully impersonate the user and perform privileged actions, even after logout and without 2FA; the organisation classified the report as out of scope.

What the attacker needed

Attacker obtains a valid session cookie; victim logs out (or token is captured); ability to intercept and modify HTTP responses

The fix

The server should invalidate the session record on logout so the token can no longer be used.

How it was found

  1. Log in with valid credentials and complete the 2FA challenge.
  2. Intercept the successful response and save the issued session cookie.
  3. Log out normally and confirm protected resources return 403.
  4. Go to the login page, enter any credentials, and intercept the 403 response.
  5. Modify the response status to 200 and inject the saved session cookie.
  6. Forward the modified response to gain full authenticated 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, the server gives your browser a session cookie, like a temporary ID card. Logging out should tell the server to cancel that ID card, but here it only deleted the cookie from the browser. Anyone who had copied the cookie could keep using it to get back into the account.

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 Bavly Zaher

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.