Skip to content
IDOR Write-up Intermediate

How I Discovered My First IDOR via API Downgrade

An API endpoint on /api/v2/users/{id} returned encrypted JSON, but downgrading to /api/v1/ returned plaintext JSON. Changing the HTTP method from POST to GET bypassed object-level authorization, allowing an attacker to read any user's private PII, including date of birth, gender, blood group, work history, and education.

medium.com

Published on medium.com

While testing a Vulnerability Disclosure Program (VDP), I discovered that an API endpoint on /api/v2/users/{id} returned encrypted JSON responses — effectively hiding all data behind a custom encryption scheme. However, by simply downgrading the API version to /api/v1/, the same endpoint responded with fully…

Md Tanjimul Islam Sifat, 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 legacy /api/v1/ endpoint lacked both the response encryption and the object-level authorization checks present in /api/v2/, and authorization was applied inconsistently across HTTP methods.

Impact

An attacker could read private PII of any user, including date of birth, gender, blood group, work history, education, and account security flags, and could enumerate thousands of profiles due to sequential IDs; the endpoint also lacked authentication entirely.

What the attacker needed

A free account; victim's numeric user ID; API endpoint accessible

The fix

The report was closed as out of scope, so it was not fixed; the recommended mitigations include a strict DTO whitelist, consistent authorization checks across all HTTP methods, deprecating /api/v1/, and not relying on response encryption alone.

How it was found

  1. Log in as an attacker account and capture the profile update request to /api/v2/users/{id} in Burp Suite.
  2. Change the API version in the URL from v2 to v1, keeping the same token and body, to get a plaintext response.
  3. Find the victim's numeric user ID from their public profile image URL.
  4. Send a POST request to /api/v1/users/{victim_id} with the attacker's token, which returns 403 Forbidden.
  5. Change the HTTP method to GET on /api/v1/users/{victim_id} with the attacker's token, which returns 200 OK with the victim's private data.
  6. Access the same GET URL in an incognito browser session without authentication, which still returns the victim'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.

An IDOR (Insecure Direct Object Reference) is when a website lets you access someone else's data just by changing an identifier like a user ID in the request. Here, the API had an older version that did not encrypt its responses and did not check whether you were allowed to read another user's profile. By switching to that older version and using a GET request, the researcher could see private details of any user.

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.

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.