Chaining IDOR to Admin Panel Takeover to SQLI
A crawled URL leaked a working user's credentials, and the profile endpoint used a guessable user_id that allowed viewing other users' profiles. The password change endpoint did not require the old password, so the attacker changed the admin's password and took over the admin panel, which exposed around 16,000 users' personal data.
medium.com
Published on medium.com
Hello Hackers, After a long time… I am back again 😀. In this write-up, I am going to share a recent bug I discovered during a freelance penetration testing engagement.
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 profile and password-change endpoints trusted the user identifier in the request without checking that it belonged to the logged-in user, and the password change did not require the current password.
Impact
The attacker could take over the admin account and access around 16,000 users' personal data, and also found an SQL injection in an internal API after gaining admin access.
What the attacker needed
A leaked credential URL; a free user account; guessable user IDs
The fix
The text does not state a fix; the endpoints should verify that the requested user ID belongs to the logged-in user and require the current password before any password change.
How it was found
- Find a crawled URL that leaks a user's credentials and log in with them.
- Open the profile page, change a value, save, and capture the request.
- Notice the guessable user_id parameter and change it to another value.
- Enumerate user IDs to find the admin's ID and email address.
- Send a password change request for the admin ID with a new password.
- Log out and log back in with the admin email and the new 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.
A user identifier was placed in the web address, and the site never checked whether the person asking was allowed to see that profile. Because the password change form also never asked for the current password, anyone who could reach another person's profile could set a new password for them. The attacker used this to take over the administrator account and see private data about many users.
What is IDOR?
One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.