IDOR to Account Takeover on https://████/index.html
An IDOR vulnerability in the profile update endpoint allowed an attacker to change another user's email address by modifying the ID parameter, without requiring the old password. This could lead to full account takeover by resetting the victim's password.
- Triaged in under an hour
- Fixed in 29 days
- Disclosed after 33 days
Summary by the program
More details about the report could be found at my blogpost: https://naglinagli.github.io/DoD_IDOR/
I would like to thank the DoD for a quick triage and resolution regarding the issue.
The report
Hello Team!
Summary:
I found when you wish to update your profile on https://███████/ after your login through https://██████████/signIn/signIn.html website due to an IDOR.
This IDOR gives you the opportunity to change the origin email for the registered account by changing the ID parameter on the following request, i assume that if i would do it on the id=1 i would takeover the admin account, this is due to not requiring the OLD password to make an email change, aswell as no restriction to make POST actions on different account IDS.
Description:
IDOR chained to full Account Takeover on ██████ domain.
Account
Step-by-step Reproduction Instructions
- Register an account at https://█████████/signIn/CreateAccount.html (Attacker)
- Login to your account and go the https://███████/signIn/account page
- Click on the "update" button located at thetop middle, and capture the request on BURP
- Now change the ID parameter on the request to the victims, change the email, and you successfully have managed to switch his email.
Request:
███
Video PoC:
█████
Suggested Mitigation/Remediation Actions
- Implementing email request change based on OLD password input
- Returning 403/401 when user account attempts to change another user ID settings.
Disclaimer
as you might notice the domain is https://██████/signIn/signIn.html when you sign in (.mil site), and it redirects you afterwards to https://██████████/ with the Compromised account, therefore i considered this In Scope.
Best Regards, Nagli
Impact
Issuing the malicious request on the victim account ID will lead to account takeover by replacing the email of the victim with the email of the attacker, and requesting a new password using the Forgot password option.
Context
The target is a U.S. Department of Defence web property. The report describes two related hosts: a sign-in site at https://██████/signIn/signIn.html on a .mil domain, and a profile application at https://███████/ where an authenticated user can view and update their account. The sign-in flow redirects the user from the .mil sign-in page to the profile application with their session.
The feature at the centre of the report is the profile update. After logging in, a user opens the account page at https://███████/signIn/account, clicks an "update" button at the top middle of the page, and the browser sends a request that carries an id parameter identifying the account being modified. That request is what allows the registered email address of an account to be changed.
Setup
Only two things are needed to reproduce the issue:
- An attacker-controlled account, registered at
https://█████████/signIn/CreateAccount.html. - A victim account whose numeric
idthe attacker knows or can guess.
The researcher captured the update request in Burp. No special role, privilege or configuration is described.
Finding it
The update request carries an id parameter identifying the account being modified. Changing the ID parameter to the victim's and the email changed the victim's email. Two properties made this serious:
- The email change did not require the old password.
- There was no restriction preventing a POST against a different account ID.
The researcher reasoned that setting id=1 would likely take over the administrator account.
Exploitation
Step 1: Register the attacker account
Create an account at:
https://█████████/signIn/CreateAccount.html
This account is the attacker's own and is used only to obtain a valid session on the profile application.
Step 2: Log in and open the account page
Log in with the attacker account and navigate to:
https://███████/signIn/account
This is the page that exposes the profile update action.
Step 3: Trigger the update and capture the request
Click the "update" button at the top middle of the page and intercept the resulting request in Burp. The request is the one that changes the account's email address.
Step 4: Swap the ID and change the email
With the request captured, change the id parameter from the attacker's own account ID to the victim's account ID, and change the email field to an address the attacker controls. Sending the modified request changes the victim's registered email. The researcher's summary of the request is shown in the report as a redacted block, so the exact parameter names and body are not reproduced here.
The report also includes a video proof of concept, referenced in the original as a redacted block, showing the same sequence.
Root cause
The request carries an id parameter that selects which account is modified. Because the email change does not require the old password, and because the endpoint accepts POST actions against arbitrary account IDs, any authenticated user can rewrite another user's email address.
In the researcher's words, the issue is due to "not requiring the OLD password to make an email change, aswell as no restriction to make POST actions on different account IDS." The report does not describe any server-side ownership check that would have stopped the request.
Impact
By issuing the modified request against a victim's account ID, an attacker replaces the victim's email with an address the attacker controls. The attacker then uses the "Forgot password" option to request a new password, which is delivered to the attacker's email, resulting in full account takeover. The researcher notes that targeting id=1 would likely take over the administrator account, though this is stated as an assumption rather than a demonstrated result.
The researcher considered the issue in scope because the login happens on the .mil sign-in page at https://██████/signIn/signIn.html, which then redirects to the profile application with the compromised account.
Fix
The report proposes two remediation actions:
- Require the old password as input when an email change is requested.
- Return 403 or 401 when a user account attempts to change another user ID's settings.
The report does not state which of these was implemented; it thanks the DoD for quick triage and resolution.
Variants to test
- Profile and settings endpoints that take an object ID in the body. Change the ID to another account's and observe whether the response reflects the change. A positive result is a successful update on an account you do not own.
- Email or password change flows without re-authentication. Attempt the change without supplying the current password. A positive result is the change being accepted.
- Numeric, sequential identifiers. Try neighbouring IDs, including low values such as
1, to see whether privileged accounts are reachable. A positive result is a successful modification of an account with a different role. - Cross-host session flows. Where sign-in happens on one host and the application on another, test whether the application derives identity from the session or from request parameters. A positive result is the parameter winning over the session.
Hunting notes
This class of bug tends to appear in profile, account and settings features where the client sends an identifier for the object being modified. During recon, look for update requests that carry an id, userId or similar parameter in the body, especially where the same request also changes security-sensitive fields such as email. A sign-in flow that redirects from one host to another is worth checking, because the application may rely on the request rather than the session for identity.
The researcher described the impact as chaining the IDOR to a full takeover: changing the victim's email and then using the forgot-password flow to request a new password. That chain, rather than the IDOR alone, is what turns a profile modification into account takeover and makes the severity clear to the program.
What happened, in plain words
A security researcher found a way to take over other people's accounts on a U.S. Department of Defence website. The site had a profile page where you could change your email address. The request that changed the email contained a number that said which account to change. The server trusted that number instead of checking who was actually logged in. By changing the number to someone else's account, the researcher could change that person's email to one the researcher controlled. Then, using the "Forgot password" option, the researcher could get a new password sent to that email and log in as the victim. This is called account takeover.
The researcher reported it to the Department of Defence, and the DoD triaged and resolved it quickly. The report was disclosed on 29 September 2020 and rated critical.
The two websites involved
The report describes two related websites:
- A sign-in page at
https://██████/signIn/signIn.html, on a.mildomain. A.mildomain belongs to the U.S. military. - A profile application at
https://███████/, where a logged-in user can see and update their account.
When you log in on the .mil sign-in page, it redirects you to the profile application with your session. A session is like a wristband at an event: after you show your ID at the entrance, the wristband proves you are allowed in, so you do not have to show your ID again at every door. On a website, the session is usually stored in a cookie, which is a small piece of data your browser keeps and sends back to the site on every request.
The feature at the centre of the report is the profile update. After logging in, you open the account page at https://███████/signIn/account, click an "update" button at the top middle of the page, and your browser sends a request that carries an id parameter. A parameter is a named value sent along with a request, like the "To:" line on an envelope. This id parameter tells the server which account is being modified. That request is what allows the registered email address of an account to be changed.
What you need to reproduce it
Only two things are needed:
- An attacker-controlled account, registered at
https://█████████/signIn/CreateAccount.html. - A victim account whose numeric
idthe attacker knows or can guess.
The researcher captured the update request in Burp. Burp is a tool that sits between your browser and the website, like a mail intercept service that lets you open an envelope, read the letter, change it, and send it on. No special role, privilege or configuration is described.
Finding it
The update request carries an id parameter identifying the account being modified. In other words, the server asked the envelope who the account was, instead of checking the wristband. Changing the ID parameter to the victim's and the email changed the victim's email. Two properties made this serious:
- The email change did not require the old password.
- There was no restriction preventing a POST against a different account ID.
POST is one of the methods a browser uses to send data to a server, typically when you submit a form. The researcher reasoned that setting id=1 would likely take over the administrator account. This kind of bug, where a request lets you reach an object (here, an account) that belongs to someone else just by changing an identifier, is called an Insecure Direct Object Reference, or IDOR.
Exploitation
Step 1: Register the attacker account
Create an account at:
https://█████████/signIn/CreateAccount.html
This account is the attacker's own and is used only to obtain a valid session on the profile application. You need a real account because the update feature only works for logged-in users; the account is the wristband that gets you to the profile page.
Step 2: Log in and open the account page
Log in with the attacker account and navigate to:
https://███████/signIn/account
This is the page that exposes the profile update action. It is the page where a normal user would change their own details, so it is the natural place to look for the request that does the change.
Step 3: Trigger the update and capture the request
Click the "update" button at the top middle of the page and intercept the resulting request in Burp. The request is the one that changes the account's email address. Intercepting means pausing the request before it reaches the server, so you can read and edit it. You do this so you can see exactly which values the browser sends, including the id parameter.
Step 4: Swap the ID and change the email
With the request captured, change the id parameter from the attacker's own account ID to the victim's account ID, and change the email field to an address the attacker controls. Sending the modified request changes the victim's registered email. The researcher's summary of the request is shown in the report as a redacted block, so the exact parameter names and body are not reproduced here.
The report also includes a video proof of concept, referenced in the original as a redacted block, showing the same sequence.
Why it worked
The request carries an id parameter that selects which account is modified. Think of a hotel receptionist who changes the room number on a guest's key card just because the guest wrote a different number on a form, without checking that the guest is booked into that room. Because the email change does not require the old password, and because the endpoint accepts POST actions against arbitrary account IDs, any authenticated user can rewrite another user's email address.
In the researcher's words, the issue is due to "not requiring the OLD password to make an email change, aswell as no restriction to make POST actions on different account IDS." The report does not describe any server-side ownership check that would have stopped the request.
Impact
By issuing the modified request against a victim's account ID, an attacker replaces the victim's email with an address the attacker controls. The attacker then uses the "Forgot password" option to request a new password, which is delivered to the attacker's email, resulting in full account takeover. The researcher notes that targeting id=1 would likely take over the administrator account, though this is stated as an assumption rather than a demonstrated result.
The researcher considered the issue in scope because the login happens on the .mil sign-in page at https://██████/signIn/signIn.html, which then redirects to the profile application with the compromised account. In bug bounty programmes, "in scope" means the target is one the programme has authorised you to test.
Fix
The report proposes two remediation actions:
- Require the old password as input when an email change is requested.
- Return 403 or 401 when a user account attempts to change another user ID's settings.
HTTP status codes are three-digit numbers a server sends back to say what happened. 401 means "you are not authenticated", and 403 means "you are authenticated but not allowed". The report does not state which of these was implemented; it thanks the DoD for quick triage and resolution.
Variants to test
- Profile and settings endpoints that take an object ID in the body. Change the ID to another account's and observe whether the response reflects the change. A positive result is a successful update on an account you do not own.
- Email or password change flows without re-authentication. Attempt the change without supplying the current password. A positive result is the change being accepted.
- Numeric, sequential identifiers. Try neighbouring IDs, including low values such as
1, to see whether privileged accounts are reachable. A positive result is a successful modification of an account with a different role. - Cross-host session flows. Where sign-in happens on one host and the application on another, test whether the application derives identity from the session or from request parameters. A positive result is the parameter winning over the session.
Hunting notes
This class of bug tends to appear in profile, account and settings features where the client sends an identifier for the object being modified. During recon, look for update requests that carry an id, userId or similar parameter in the body, especially where the same request also changes security-sensitive fields such as email. A sign-in flow that redirects from one host to another is worth checking, because the application may rely on the request rather than the session for identity.
The researcher described the impact as chaining the IDOR to a full takeover: changing the victim's email and then using the forgot-password flow to request a new password. That chain, rather than the IDOR alone, is what turns a profile modification into account takeover and makes the severity clear to the program.
Glossary
- IDOR (Insecure Direct Object Reference): a bug where a request lets you reach someone else's data or account just by changing an identifier such as a number.
- Account takeover: when an attacker gains control of another person's account, for example by changing their email and resetting their password.
- Session: the state that keeps you logged in after you sign in, usually stored in a cookie.
- Cookie: a small piece of data a website stores in your browser and receives back on later requests, often used to identify your session.
- Parameter: a named value sent with a request, such as
id=1. - POST: an HTTP method used to send data to a server, typically when submitting a form.
- HTTP status code: a three-digit number a server returns to say what happened, such as 401 (not authenticated) or 403 (not allowed).
- Burp: a tool that intercepts and lets you modify requests between your browser and a website.
- Endpoint: a specific URL on a server that performs an action or returns data.
- Recon: the information-gathering phase of security testing, where you look for interesting pages and requests.
- In scope: a target that a bug bounty programme has authorised you to test.
- Proof of concept (PoC): a demonstration that a vulnerability can actually be exploited.
- Forgot password flow: the feature that lets you reset your password by receiving a link or code at your registered email address.
.mildomain: an internet domain belonging to the U.S. military.