Skip to content
IDOR Write-up Intermediate

From Org Switcher to Org Takeover: An IDOR Story

The organization switching endpoint trusted a client-controlled cookie containing the user's email address, so an attacker could change the organization ID and email to match a victim's organization and obtain access tokens. This allowed full access to any organization's data and actions.

xploiterr Follow

Published on medium.com

I was testing this private program in which a user can be a part of multiple organizations and the user can switch to different organizations from the dropdown.

xploiterr, on medium.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.

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 server trusted the email address from a client-side cookie instead of verifying it against the authenticated session when issuing access tokens for an organization.

Impact

An attacker could gain full access to any organization, including viewing all data and performing any actions, as long as they know the victim's email and organization ID.

What the attacker needed

Attacker has an account; knows victim's email and org ID

The fix

The server should not trust the email from a cookie; it should derive the user's identity from the authenticated session and verify that the user belongs to the requested organization before issuing tokens.

How it was found

  1. Intercept the organization switch request and note the organizationId parameter and the email cookie.
  2. Change organizationId to a victim's organization and set the email cookie to the victim's email.
  3. Send the request and receive access tokens for the victim's organization.
  4. Replace the token and CSRF token in subsequent requests to access the organization's data.

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.

When you switch between organizations, the system checks if your email matches the organization. But it reads your email from a cookie that you can edit. So an attacker can put someone else's email and organization ID to get access to that organization.

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.

More by xploiterr

View all

19 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.