IDOR Vulnerability: A Journey to Full Account Takeover
The 'add new profile' feature used a licence_ID parameter to determine which company a new user was added to, and this parameter was not checked against the authenticated user's company. An attacker could change the licence_ID to a victim's company ID, add themselves as an admin user, and then edit or delete other users, leading to full account takeover.
awais0x01.medium.com
Published on awais0x01.medium.com
awais0x01
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.
Context
This is a write-up of an IDOR that led to full account takeover on a public bug bounty program with a large scope of more than 4000 assets. The researcher picked a random domain from that scope and refers to it throughout as Redacted.com, so the real hostname is not disclosed here.
The target has account creation functionality. When a user signs up, the form includes a company name field, which means a company is created by default at the same time and the new user is added to that company. Admin users can then add more users as admin within the company, and those users can edit or delete other users. The feature at the centre of the finding is the "add new profile" flow used to add a user to a company.
Setup
No reconnaissance was done. The researcher's usual approach is to explore the sign-up and login features of a target, and that is how this one was approached.
Two accounts were needed to test for IDOR:
- account_A, the attacker's account.
- Account_B, the second account, which later plays the role of the victim's account.
To keep both sessions available in one browser, the researcher used the "multi_accounts" Firefox addon, also known as Multi-Account Containers (https://addons.mozilla.org/en-US/firefox/addon/multi-account-containers). Requests were intercepted and modified with Burp Suite, and Burp Intruder is used later for brute forcing.
Finding it
While exploring the "add new profile" feature, the researcher noticed that the HTTP request for adding a new user profile contains several IDs, namely co_UID, user_UID and licence_ID, with values in the form of 12345. Those identifiers are the natural place to look for an IDOR: if the server trusts them to decide which company the new user lands in, changing them should move the user to another company.
The first hypothesis was that co_UID, the company UID, is what places a user into a company. The plan was therefore to add a user to Account_B with admin privileges by swapping that value.
Exploitation
Step 1: Change co_UID to the victim's company
While adding a new user to ACCOUNT_A, the request was intercepted in Burp Suite and the co_UID was replaced with ACCOUNT_B's co_UID. The expectation was that, if the IDOR existed, a user could be added to ACCOUNT_B with admin privileges.
The request was sent, but the user was added to ACCOUNT_A instead. The attempt was unsuccessful, and the researcher decided to give up at this point, reasoning that company_UID (co_UID) would normally be the parameter responsible for adding users into a company.
Step 2: Change licence_ID instead
Before closing the testing, the researcher changed the licence_ID of ACCOUNT_A to the licence_ID of ACCOUNT_B while adding a new user.
The response was 200 OK, and a new user was added to ACCOUNT_B, the victim's account. The attacker-controlled user was therefore placed into the company belonging to ACCOUNT_B. Because users in a company can edit or delete other users, this leads to a full account takeover. In practice, the licence_ID is the value responsible for adding users to the company, not co_UID.
Step 3: Obtain the victim's licence_ID
Adding a user to another company is only useful if the attacker knows that company's licence_ID. The researcher explains that when new accounts are created, the company licence_ID is generated in an incremental pattern, for example 1112, 1113 and 1114. That predictability makes it easy to brute force licence_ID with Burp Intruder while adding the user to the victim's company.
Root cause
The server placed the new user in the company selected by the licence_ID supplied in the request, rather than by co_UID. The value that looks like the company identifier, co_UID, is not the one that controls the placement, which is why the first attempt failed and why the parameter may be ignored by other security researchers. The licence_ID effectively acts as the company UID.
Two factors make the issue worse. First, the licence_ID is generated in an incremental pattern, so it can be brute forced. Second, users in a company can edit or delete other users, so a successful placement leads to account takeover.
Impact
An attacker who can create an account can add an attacker-controlled user to another company by supplying that company's licence_ID. The added user can then edit or delete other users in that company, which the researcher describes as a full account takeover of the victim's account. The condition is knowledge of the victim's licence_ID, which the incremental generation makes practical to brute force. The report does not state how many accounts or companies were affected, nor whether the program paid a bounty.
Fix
The report does not say what was changed by the program. Based on the finding, the server should verify that the authenticated caller is authorised for the licence_ID (and any other company identifier) supplied in the request, rather than trusting it to select the target company.
Variants to test
- Swap every identifier in the request, one at a time. Change
co_UID,user_UIDandlicence_IDseparately and observe which one actually moves the created object into the other account. A positive result is the created object appearing in the second account. - Look for a licence or subscription identifier that doubles as a tenant identifier. Where a request carries both a company UID and a licence ID, test the licence ID as the tenant selector, since the obvious company field may be ignored.
- Check whether identifiers are sequential. Create several accounts and compare the generated company or licence identifiers. A positive result is a predictable increment such as 1112, 1113, 1114, which makes enumeration with Burp Intruder feasible.
- Test the same swap on other user-management actions. A positive result is a successful action against a user in the second account.
- Verify the resulting privileges. After a successful placement, confirm whether the added user can edit or delete other users in the target company, which is what turns the IDOR into account takeover.
What happened, in plain words
A security researcher found a way to add his own user account to somebody else's company account on a website, and from there to edit or delete the other people in that company. The website was part of a public bug bounty program, which is a scheme where companies invite independent researchers to look for security problems in their systems and report them, sometimes for a reward. The program had a very large scope, more than 4000 assets, meaning thousands of websites and services were fair game. The researcher picked one domain at random and calls it Redacted.com throughout so the real name stays private.
The trick was simple once he found it. When you add a new user to a company, the website's request carries a few numbers that identify things: the company, the user, and a licence. He first tried changing the company number, and nothing happened. Then he changed the licence number to the one belonging to a second account he controlled, and the new user landed in that second account instead. Because users in a company can edit or delete each other, that is effectively control of the account. The licence numbers were also handed out in a simple counting sequence, so guessing somebody else's number was easy.
This article walks through the same steps for someone who has never done security testing before. Every tool and term is explained as it comes up.

The background: what the site does
The researcher's normal habit is to start with the sign-up and login pages of a target, without doing any reconnaissance first. Reconnaissance means gathering information about a target before attacking it, for example listing its subdomains or reading its public code. He skipped all of that here and just registered an account.
Redacted.com lets you create an account. The sign-up form includes a company name field, which tells you something important about how the site is built: creating a user also creates a company at the same time, and the new user is placed inside that company. Think of it like a gym membership where signing up automatically opens a gym in your name and makes you its first member.

Admin users can then add more users to the company as admins, and those users can edit or delete other users.

That last sentence is the part that turns a small bug into a big one. If you can get yourself into someone else's company as an admin, you can change or remove the people who work there.
The feature under test: adding a new profile
The researcher started exploring the "add new profile" feature, which is the screen used to add a user to a company. While doing so he looked at the HTTP request that the browser sends when the form is submitted. An HTTP request is the message your browser sends to a web server to ask it to do something, for example "save this new user". You can see these messages with a tool that sits between your browser and the server and lets you read and edit them before they are sent.
In that request he noticed several IDs: co_UID, user_UID and licence_ID, with values in the form of 12345. An ID is just a number or short string that uniquely identifies a record in a database, the way a student number identifies one student. co_UID looks like it means company unique ID, user_UID a user unique ID, and licence_ID a licence ID.

Those identifiers are the natural place to look for an IDOR. IDOR stands for Insecure Direct Object Reference: it is when a website lets you ask for a record by its ID and does not check that the record belongs to you. A simple everyday comparison: a cloakroom gives you a ticket with a number, and if the attendant hands over any coat whose number you name, without checking that the ticket is yours, that is an IDOR. Here the question was whether the server trusts the numbers in the request to decide which company the new user lands in. If it does, changing a number should move the user to another company.
The first hypothesis was that co_UID, the company ID, is what places a user into a company. The plan was therefore to add a user to Account_B with admin privileges by swapping that value.
Setting up two accounts
To test for IDOR you need two accounts, so you can try to make one affect the other:
- account_A, the attacker's account, the one the researcher controls and uses to send the requests.
- Account_B, the second account, which later plays the role of the victim's account.
Keeping both sessions available in one browser is awkward, because most browsers keep one login per site. A session is the period during which the server remembers who you are, usually by storing a small piece of data in your browser called a cookie. The researcher used the "multi_accounts" Firefox addon, also known as Multi-Account Containers (https://addons.mozilla.org/en-US/firefox/addon/multi-account-containers). Containers let one browser hold separate sets of cookies, so you can be logged in as two different people in two tabs at once. It is like having two separate key rings for two different houses.
Requests were intercepted and modified with Burp Suite. Burp Suite is a program that acts as a proxy: your browser sends its traffic through it, and it can pause each request so you can read it, change it, and then forward it. Burp Intruder, a part of the same tool, is used later for brute forcing. Brute forcing means trying many values automatically, one after another, instead of guessing by hand.
Exploitation
Step 1: Change co_UID to the victim's company
While adding a new user to ACCOUNT_A, the request was intercepted in Burp Suite and the co_UID was replaced with ACCOUNT_B's co_UID. The expectation was that, if the IDOR existed, a user could be added to ACCOUNT_B with admin privileges.
The request was sent, but the user was added to ACCOUNT_A instead. The attempt was unsuccessful, and the researcher decided to give up at this point, reasoning that company_UID (co_UID) would normally be the parameter responsible for adding users into a company. A parameter is one of the named values in a request, like a field on a form; changing a parameter is how you test whether the server pays attention to it.

The user was added to ACCOUNT_A instead, so the co_UID swap did not move the user. That is actually the safer behaviour: the server should not let a client tell it which company to write to.
Step 2: Change licence_ID instead
Before closing the testing, the researcher changed the licence_ID of ACCOUNT_A to the licence_ID of ACCOUNT_B while adding a new user.
The response was 200 OK, and a new user was added to ACCOUNT_B, the victim's account. A response is the server's reply to a request, and 200 OK is the standard HTTP status code meaning "the request succeeded". The attacker-controlled user was therefore placed into the company belonging to ACCOUNT_B. Because users in a company can edit or delete other users, this leads to a full account takeover. Account takeover means gaining control of somebody else's account, here by becoming a member of their company with the power to change or remove its users. In practice, the licence_ID is the value responsible for adding users to the company, not co_UID.
This is the heart of the finding. The field that looked like the company identifier was ignored, and a field that looked like it was about billing or licensing was actually the one that chose the company. The licence effectively acted as the company ID.
Step 3: Obtain the victim's licence_ID
Adding a user to another company is only useful if the attacker knows that company's licence_ID. The researcher explains that when new accounts are created, the company licence_ID is generated in an incremental pattern, for example 1112, 1113 and 1114. Incremental means each new value is the previous one plus one, like the ticket numbers at a deli counter. That predictability makes it easy to brute force licence_ID with Burp Intruder while adding the user to the victim's company: you tell Intruder to send the same request many times, each time with the next number in the sequence, and watch for the one that succeeds.

Why it worked
The server placed the new user in the company selected by the licence_ID supplied in the request, rather than by co_UID. Authorised here means "allowed": the server never checks that the logged-in user actually owns the licence number they are quoting. The value that looks like the company identifier, co_UID, is not the one that controls the placement, which is why the first attempt failed and why the parameter may be ignored by other security researchers. The licence_ID effectively acts as the company UID.
Two design weaknesses make the issue worse. First, the licence_ID is generated in an incremental pattern, so it can be enumerated rather than guessed. Enumerated means walked through systematically, one value after another, which is only practical when the values are predictable. Second, once a user is added to a company, the role model allows that user to edit or delete other users, so a single successful placement escalates to control over the victim's account. A role model is the set of permissions attached to each kind of user, such as admin or ordinary member.
Impact
An attacker who can create an account can add an attacker-controlled user to another company by supplying that company's licence_ID. The added user can then edit or delete other users in that company, which the researcher describes as a full account takeover of the victim's account. The condition is knowledge of the victim's licence_ID, which the incremental generation makes practical to brute force. The report does not state how many accounts or companies were affected, nor whether the program paid a bounty.
Fix
The report does not say what was changed by the program. Based on the finding, the server should verify that the authenticated caller is authorised for the licence_ID (and any other company identifier) supplied in the request, rather than trusting it to select the target company. In plain terms, when a request says "put this user in company 1113", the server should first check that the person sending the request really belongs to company 1113.
Variants to test
If you want to try the same idea on a target of your own, these are the directions the finding suggests:
- Swap every identifier in the request, one at a time. Change
co_UID,user_UIDandlicence_IDseparately and observe which one actually moves the created object into the other account. A positive result is the created object appearing in the second account. - Look for a licence or subscription identifier that doubles as a tenant identifier. A tenant is one customer organisation on a shared service, here the company. Where a request carries both a company UID and a licence ID, test the licence ID as the tenant selector, since the obvious company field may be ignored.
- Check whether identifiers are sequential. Create several accounts and compare the generated company or licence identifiers. A positive result is a predictable increment such as 1112, 1113, 1114, which makes enumeration with Burp Intruder feasible.
- Test the same swap on other user-management actions. A positive result is a successful action against a user in the second account.
- Verify the resulting privileges. After a successful placement, confirm whether the added user can edit or delete other users in the target company, which is what turns the IDOR into account takeover.
Glossary
- Account takeover: gaining control of somebody else's account, for example by becoming able to change its users or settings.
- Admin: a user with extra permissions, here the ability to add, edit or delete other users in a company.
- API: a way for one program to talk to another over the network, usually by sending requests and receiving responses; the requests in this article are examples of that kind of traffic.
- Asset: one website, service or system that is in scope for a bug bounty program.
- Authorised: allowed; a server should check that the caller is permitted to perform the action it is asking for.
- Brute force: trying many possible values automatically until one works.
- Bug bounty program: a scheme where a company invites independent researchers to find and report security problems, sometimes for a reward.
- Burp Intruder: the part of Burp Suite that sends the same request many times with different values, used for brute forcing.
- Burp Suite: a tool that sits between your browser and a server so you can read, pause and change requests.
- Company UID (
co_UID): the identifier for a company in the site's database. - Cookie: a small piece of data a site stores in your browser so it can recognise you on later requests.
- Enumeration: walking through a list of values systematically, one after another.
- HTTP request: the message a browser sends to a server asking it to do something.
- HTTP response: the server's reply to a request, including a status code and usually some data.
- ID: a number or short string that uniquely identifies a record in a database.
- IDOR (Insecure Direct Object Reference): a bug where a site lets you name a record by its ID and does not check that the record belongs to you.
- Incremental: increasing by a fixed step, usually one, each time a new value is created.
- Licence ID (
licence_ID): the identifier for a licence in the site's database; here it turned out to decide which company a new user joins. - Multi-Account Containers: a Firefox addon that keeps separate sets of cookies, so you can be logged in as different users in different tabs.
- Parameter: a named value in a request, like a field on a form.
- Proxy: a program that traffic passes through, so it can be inspected and modified.
- Reconnaissance: gathering information about a target before testing it, such as listing its subdomains.
- Role model: the set of permissions attached to each kind of user, such as admin or ordinary member.
- Scope: the list of systems a bug bounty program allows you to test.
- Session: the period during which a server remembers who you are, usually tracked with a cookie.
- Status code 200 OK: the standard HTTP reply meaning the request succeeded.
- Tenant: one customer organisation on a shared service; here, a company.
- User UID (
user_UID): the identifier for a user in the site's database.