Skip to content
Access control Write-up Intermediate

Authentication Bypass via Session Token Reuse Leading to Account

A session management flaw allowed an attacker to reuse a valid session cookie from one account to access another account's data by changing the HTTP method from POST to GET. This could lead to full account takeover and exposure of sensitive personal information.

youssef awad Follow

Published on medium.com

Recently I started hunting on a self-hosted program in which I got a medium severity bug in it.

youssef awad, 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

Likely the server did not properly validate the session cookie against the requested user, and the authentication check differed between HTTP methods.

Impact

An attacker could impersonate any user without a password or MFA, leading to full account takeover and exposure of sensitive PII such as full names, email addresses, and unique user GUIDs.

What the attacker needed

A valid session cookie from any account; knowledge of the victim's user identifier

How it was found

  1. Create two accounts, A and B, and obtain their session cookies.
  2. Send a request to the /api/v1/User/me endpoint using account B's cookie but with account A's cookie value (reverse test).
  3. Observe that the request returns 401 Unauthorized.
  4. Change the HTTP method from POST to GET and resend the request.
  5. Receive a 200 OK response containing the victim's data.

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 session cookie, like a temporary ID card. The bug meant that if an attacker got hold of someone else's ID card, they could use it to read that person's private information, even though the site normally checks the ID card on each request. By changing the request type from POST to GET, the check was bypassed.

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.

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.