Skip to content
Account takeover Write-up Intermediate

RCE via Account Takeover

The user ID was passed in the URL for account details and password change, allowing tampering to change another user's password without knowing the current one. The attacker changed the admin's password, gained admin access, and used a PHP execution feature to obtain a reverse shell.

Karthikeyan.V Follow

Published on medium.com

In this blog, I am going to share a bug that I came across while performing VAPT for a private project.

Karthikeyan, 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 application trusted a user-supplied identifier in the URL for account operations without checking that it belonged to the logged-in user, and the admin account also had a PHP execution feature enabled.

Impact

An attacker could take over any account including the administrator's and then execute arbitrary PHP code to gain a reverse shell on the server.

What the attacker needed

A user account on the CMS; knowledge of another user's ID (admin ID is one)

The fix

The application should verify that the user ID in account operations belongs to the authenticated user, and the PHP execution extension should be removed or disabled.

How it was found

  1. Navigate to the My Account section and observe the UserID in the URL.
  2. Tamper with the UserID value and see another user's details.
  3. Go to the Change Password page, change the UserID to another user's ID, and set a new password without the current one.
  4. Change the admin's password (user ID one) and log in as admin.
  5. Use the admin-only PHP code execution option to run a reverse shell payload.
  6. Start a listener and receive a reverse shell connection.

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.

The website used a number in the web address to identify which user's account to show or change. By changing that number, the attacker could act as another user, including the administrator. Once inside the admin account, a feature that runs PHP code let the attacker start a remote shell on the server.

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 Karthikeyan.V

View all

7 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.