Skip to content
IDOR Write-up Intermediate

Account Takeover by Chaining Two IDORs

Two IDOR vulnerabilities in a helpdesk app allowed an attacker to add any manager to their department and then change that manager's password, leading to full account takeover without victim interaction. The chain also worked across organisations, enabling takeover of admin accounts in other organisations.

Demon Follow

Published on r29k.com

How two simple IDORs, harmless on their own, combined into full account takeover in a helpdesk app.

Sheraz Khalid, on r29k.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.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 4 min read.

Context

This is a chain of two IDORs in a helpdesk application, found during a few months spent on the program. Neither bug is interesting on its own, and the write-up is really about noticing that one flow quietly unlocks the other. No victim interaction is required at any point.

The application has three roles:

Role What it can do
admin Manages everything, including organisation settings
manager Most access, except organisation settings
user Only handles assigned tasks

Admins create departments and assign managers to them. They can also add and edit users, change emails, change passwords and lock accounts. The two flows that matter here are the department assignment flow and the user edit flow.

Setup

The researcher worked with more than one account. The write-up mentions a second test account whose manager id was used as the target of the password-change request, and it describes adding a manager to "my department", so at minimum an account able to create a department and assign managers, plus a separate manager account to attack. Burp was used to capture and modify requests. No versions or specific endpoints are given in the report.

Finding it

IDOR #1: assigning a department

The assign-department action is simple: create a department, add a manager, click save. The request carries the manager's id. Swapping that id for another manager's id caused the application to add that manager to the researcher's department, including a manager who belonged to a completely different organisation. That last detail is what makes the bug reach beyond your own tenant.

On its own it looked low impact, mostly a way to spam managers across departments, so it was documented and set aside.

IDOR #2: editing a user

The user edit feature is where admins change a user's or manager's email and password. Capturing a password-change request in Burp showed that it included the user id. Replacing that id with the manager id from the second test account and sending the request returned 200, and the password changed. The researcher then logged straight into that manager account.

Exploitation

Step 1: pull the target manager into your department

Use the department-assign IDOR to add the target manager to your own department. The request carries the manager's id, and substituting another manager's id, even one from a different organisation, is accepted.

Step 2: retarget the password-change request

Take the captured password-change request from the user edit flow and replace the user id with the id of the manager you just added. The report does not reproduce the raw request, only the fact that the id parameter is the one being swapped.

Step 3: confirm the response

The server returns 200 and the password is updated. When the target manager is not in your department, the same request returns 403 instead.

Step 4: log in

Authenticate to the manager account with the new password.

The catch

The first attempt looked like a clean P1 until the researcher started recording the proof of concept and the request began returning 403 instead of 200. The explanation was the link between the two bugs: the password change only works for managers who are currently in the attacker's department. The earlier success had worked because the first IDOR had already placed that manager there. The PoC was aimed at a manager who had not been added, hence the 403. That was the chain revealing itself.

Root cause

The department-assign action accepts a manager id supplied by the client, and a manager from another organisation can be attached to the attacker's department; the report does not describe the server-side check. The password-change action accepts a user id supplied by the client, and the change only succeeds for managers currently in the caller's department. Because membership is the only gate, and membership can be granted through the first bug, the second bug becomes an account takeover. The report does not describe the server-side code, so the exact checks are not shown; the membership gate is stated explicitly, and cross-organisation assignment is shown by behaviour.

Impact

Chained, the two bugs give full account takeover with no victim interaction. Because the first IDOR reaches managers in other organisations, the chain extends outside the attacker's own organisation. The researcher verified it against admin accounts in other organisations as well.

Fix

The obvious fixes are to validate on the server that the manager id in the department-assign request belongs to the caller's organisation, and to authorise the password-change request against the caller's actual rights over the target user rather than against department membership alone.

Variants to test

  1. Cross-tenant object references in assignment flows. Swap ids in any "add member to group/department/team" request for ids from another tenant. A positive result is the foreign object appearing in your group.
  2. Id swaps in privileged edit flows. Capture password, email and lock/unlock requests and substitute another user's id. A 200 with the change applied is the signal.
  3. Membership-gated actions. For any action that only works on objects in your scope, try to widen the scope with a separate bug and then retry. A 403 turning into 200 after the scope change confirms the chain.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 9 min read.

What happened, in plain words

A security researcher spent a few months testing a helpdesk application. While testing it, the researcher found two separate bugs. Each one, on its own, looked small and not very useful. But when the two were used one after the other, they let an attacker take over someone else's account completely, without the victim having to click anything or do anything at all.

This article walks through that chain from the beginning. It assumes you can use a browser and a computer, and nothing more. Every technical word is explained the first time it appears, and there is a glossary at the end.

The target

The application had three kinds of user, called roles. A role is simply a label that decides what a person is allowed to do once they log in.

Role What it can do
admin Manages everything, including organisation settings
manager Most access, except organisation settings
user Only handles assigned tasks

An organisation here means a company or team using the app. Each company has its own space inside the app, and normally one company should never be able to touch another company's data.

Admins can create departments and assign managers to them. A department is a group inside the company, like "Billing" or "Support". Admins can also add and edit users, change their email addresses, change their passwords and lock accounts. The two features that matter in this story are the department assignment feature and the user edit feature.

What an IDOR is

Both bugs in this report are the same kind of mistake, called an IDOR, short for Insecure Direct Object Reference. The name sounds heavy, but the idea is simple.

Imagine a hotel where every room key has the room number printed on it, and the front desk hands you a key without checking that the room is actually yours. If you swap the number on your key for another number, the door still opens. The hotel trusted the number on the key instead of checking whether you were allowed in that room.

In a web app, the "room number" is usually an id, a short identifier the app uses to tell records apart. When you save a form, your browser sends a request to the server, the computer that runs the app, and that request often contains an id saying which record to act on. If the server accepts whatever id arrives without checking that you are allowed to touch that record, you have an IDOR. You just change the id and the server does what you asked.

The setup

To test this, the researcher needed more than one account. The write-up mentions a second test account, whose manager id was used as the target of the password-change request, and it describes adding a manager to "my department". So at minimum the researcher had an account that could create a department and assign managers, plus a separate manager account to attack.

Requests were captured and modified with Burp, short for Burp Suite. Burp is a tool that sits between your browser and the server, like a postal worker who opens every letter, lets you read it, and lets you rewrite it before sending it on. That is how you see the hidden parts of a request, such as the id, and change them before they reach the server.

The report does not give software versions or specific web addresses (endpoints) for the app.

Finding it

IDOR #1: assigning a department

The assign-department action is simple: create a department, add a manager, click save. Behind the save button, the browser sends a request to the server, and that request carries the manager's id, the number that identifies which manager to add.

By swapping that id for another manager's id, the researcher caused the application to add that other manager to the researcher's department. This even worked for a manager who belonged to a completely different organisation. That last detail is what makes the bug reach beyond your own company: normally one company's space should be sealed off from another's.

On its own the bug looked low impact, mostly a way to spam managers across departments, so the researcher wrote it down and set it aside.

IDOR #2: editing a user

The user edit feature is where admins change a user's or manager's email and password. The researcher captured a password-change request in Burp and saw that it included the user id, the number identifying whose password is being changed.

Replacing that id with the manager id from the second test account and sending the request returned 200, and the password changed. 200 is an HTTP status code, a short number the server sends back to say how the request went. 200 means "OK, done". The researcher then logged straight into that manager account using the new password.

Exploitation

The chain has four steps.

Step 1: pull the target manager into your department

Use the department-assign IDOR to add the target manager to your own department. The request carries the manager's id, and substituting another manager's id, even one from a different organisation, is accepted. The reason for this step is that the second bug, as we will see, only works on managers who are in your department. So first you make the target be in your department.

Step 2: retarget the password-change request

Take the captured password-change request from the user edit flow and replace the user id with the id of the manager you just added. The report does not reproduce the raw request, only the fact that the id parameter is the one being swapped. A parameter is a named value inside a request, like a field on a form; here the field is the id.

Step 3: confirm the response

The server returns 200 and the password is updated. When the target manager is not in your department, the same request returns 403 instead. 403 means "Forbidden": the server understood the request but refused to do it.

Step 4: log in

Authenticate to the manager account with the new password. Authenticate just means log in, proving you are who you say you are.

The catch

The first attempt looked like a clean P1. P1 is bug-bounty shorthand for the highest priority, the most serious kind of finding. But then the researcher started recording the proof of concept, a video or set of steps showing the bug actually working, and the request began returning 403 instead of 200.

The explanation was the link between the two bugs: the password change only works for managers who are currently in the attacker's department. The earlier success had worked because the first IDOR had already placed that manager there. The proof of concept was aimed at a manager who had not been added, hence the 403. That was the chain revealing itself: the two bugs were not independent after all.

Root cause

A root cause is the underlying mistake that makes a bug possible, as opposed to the symptom you see.

The department-assign action accepts a manager id supplied by the client, meaning the browser, and a manager from another company can be attached to the attacker's department. So a manager from another company can be attached to the attacker's department.

The password-change action accepts a user id supplied by the client, and the change only succeeds for managers currently in the caller's department. In other words, the server asks "is this person in your department?" instead of "are you allowed to change this person's password?". Because membership is the only gate, and membership can be granted through the first bug, the second bug becomes an account takeover.

The report does not describe the server-side code, so the exact checks are not shown. The membership gate is stated explicitly, and cross-organisation assignment is shown by behaviour.

Impact

Impact means the real-world damage a bug can cause. Chained, the two bugs give full account takeover with no victim interaction: the attacker ends up inside someone else's account, and the victim never has to click a link or approve anything.

Because the first IDOR reaches managers in other organisations, the chain extends outside the attacker's own organisation. The researcher verified it against admin accounts in other organisations as well.

Fix

A fix is the change that closes the bug. The obvious fixes are to validate on the server that the manager id in the department-assign request belongs to the caller's organisation, and to authorise the password-change request against the caller's actual rights over the target user rather than against department membership alone.

Variants to test

Variants are other places where the same mistake might appear. If you are learning, these are useful things to try on a system you are allowed to test.

  1. Cross-tenant object references in assignment flows. A tenant is one customer's isolated space in a shared app. Swap ids in any "add member to group/department/team" request for ids from another tenant. A positive result is the foreign object appearing in your group.
  2. Id swaps in privileged edit flows. Capture password, email and lock/unlock requests and substitute another user's id. A 200 with the change applied is the signal.
  3. Membership-gated actions. For any action that only works on objects in your scope, try to widen the scope with a separate bug and then retry. A 403 turning into 200 after the scope change confirms the chain. Role escalation means getting a more powerful role than you were given.

Key takeaway

It took some persistence to spot the link between the two flows. The lesson: do not ignore small findings, try to connect them. If a flow looks harmless on its own, ask how it might combine with other actions. That mindset is what turns minor issues into high-impact ones.

Glossary

  • IDOR (Insecure Direct Object Reference): a bug where the server accepts an id from the browser and acts on that record without checking that you are allowed to touch it.
  • Role: a label on an account that decides what it is allowed to do, such as admin, manager or user.
  • Organisation (tenant): one company's isolated space inside a shared application.
  • Department: a group inside a company, such as "Billing", that managers can be assigned to.
  • Endpoint: the specific web address a request is sent to.
  • Request: the message your browser sends to the server when you do something, such as saving a form.
  • Response: the message the server sends back.
  • Parameter: a named value inside a request, like a field on a form.
  • Id: a short identifier the app uses to tell records apart.
  • Server: the computer that runs the application and answers requests.
  • Client: the browser, the program making requests on your behalf.
  • Burp (Burp Suite): a tool that sits between browser and server so you can read and modify requests.
  • HTTP status code: a short number in the response saying how the request went; 200 means OK, 403 means forbidden.
  • 200: the server did what was asked.
  • 403: the server understood the request but refused it.
  • Authenticate: log in and prove who you are.
  • Account takeover: getting into someone else's account and controlling it.
  • Proof of concept (PoC): a recording or set of steps showing a bug actually working.
  • P1: bug-bounty shorthand for the highest priority, most serious finding.
  • Root cause: the underlying mistake that makes a bug possible.
  • Impact: the real-world damage a bug can cause.
  • Fix: the change that closes the bug.
  • Variant: another place where the same kind of mistake might appear.
  • Role escalation: getting a more powerful role than you were given.
  • Cross-tenant: reaching from one company's space into another's.

More by Demon

View all

6 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Insecure direct object reference (IDOR)

The lesson behind this report.

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.