Skip to content
Account takeover Write-up Intermediate

Account Take Over by Response Manipulation

The login API returned a 401 Unauthorized response for incorrect credentials, but the client-side application trusted the response body to determine authentication success. By replacing the 401 response with a 200 OK signup response and altering the email field, an attacker could log into another user's account without knowing the password.

Naveen J Follow

Published on thevillagehacker.medium.com

Naveen J

Naveen J, on thevillagehacker.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 client-side application trusted the server's response body to determine authentication success, rather than relying on server-side session validation.

What the attacker needed

A free account; ability to intercept and modify responses; victim's email address

How it was found

  1. Sign up for Account 1 and verify the email.
  2. Log out and log in again, intercepting the login request and response.
  3. Create Account 2 and capture its signup response.
  4. Log in with Account 1 using a wrong password, intercept the 401 Unauthorized response.
  5. Replace the 401 response with Account 2's 200 OK signup response, change the email parameter to Account 1's email, and forward the request.
  6. Observe that the application redirects to Account 1's settings page, indicating successful login without the correct password.

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 checks your password and sends back a message saying if you are allowed in. Here, the app believed whatever message came back, even if it was faked. So an attacker could change the 'no' message to a 'yes' message and get into someone else's account.

What is Account takeover?

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.

More by Naveen J

View all

2 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Account takeover

The lesson behind this report.

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.