Skip to content
Account takeover Write-up Intermediate

Interesting Bugs — 1

The application's client-side code used a server-supplied flag to decide whether to show a password-change form, and that form did not ask for the old password. By intercepting the login response and changing the flag to indicate a first-time login, an attacker could set a new password for any existing account, including the admin's.

medium.com

Published on medium.com

This is a very interesting bug that I found when I’m doing penetration testing for a web application. at first, I did all the usual scanning and usual testing procedures like XSS, SQL injection, possible RCE with file upload and etc. After all the initial testing I just went through the source code line by line.

Himash, 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 relied on a client-side flag to gate a password-change flow and did not require the current password or re-authentication, allowing the flag to be tampered with.

Impact

An attacker could change the password of any existing user, including the administrator, and take over the account.

What the attacker needed

A valid account to log in; ability to intercept and modify responses

The fix

The password-change flow should require the current password or a fresh re-authentication, and the server should enforce this rather than relying on a client-side flag.

How it was found

  1. Log in and intercept the server's response with a proxy.
  2. Change the first_time parameter from 0 to 1 in the response.
  3. The password-change form appears without asking for the old password.
  4. Set a new password for the target account, such as the admin's.

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 sends back some data that the web page uses to decide what to show. Here, the page trusted a value from the server to decide whether to display a password-change form, and that form did not ask for the current password. By tampering with that value in transit, an attacker could make the form appear and then set a new password for 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.

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.