Chaining Multiple Vulnerabilities to Gain Admin Access
The application had multiple IDOR vulnerabilities that allowed a regular user to create an account on the admin site, bypass 2FA, and modify other users' data including changing their email and 2FA settings. By chaining these flaws, the attacker could take over an admin account and gain full administrative access.
Published on nahamsec.com
Vulnerability Write-Ups
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 failed to verify that the authenticated user had permission to modify the requested user ID, and it also did not properly enforce 2FA setup, allowing an attacker to set a new 2FA code for any user.
Impact
An attacker could escalate from a regular user to an administrator, gaining full control over the application and potentially accessing or modifying sensitive data.
What the attacker needed
A regular user account; ability to access the admin site; knowledge of a target user ID
How it was found
- Register on the admin site by adding the missing securityQuestions parameter to the registration request.
- Log in with the newly created account; 2FA is bypassed by using any code (e.g., 123456).
- Use the endpoint /api/users/newAuthenticationCode/{user_id} with an empty POST to generate a new 2FA secret for any user ID.
- Use the endpoint /api/users/authenticationCode/{secret} to retrieve the QR code and set up 2FA for the target user.
- Change the target user's email via the PUT /api/users endpoint by altering the id value.
- Perform a password reset for the target user's email to gain access to the admin account.
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.
This report describes several security holes that let a normal user become an administrator. The main problem was that the application trusted the user ID sent in requests without checking if the user was allowed to change that data, so by changing the ID, the attacker could modify other accounts. Also, the two-factor authentication could be bypassed because the system accepted any code when none was set up.
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.