Skip to content
IDOR Write-up Beginner

Broken Access Control Leads to Addition of malicious file

The API endpoint that links an uploaded file to a folder did not verify that the caller had permission over the target folder and company IDs. An attacker could link a file from their own account into another organisation's folder, despite the server returning a 500 error.

saurabhcsec Follow

Published on medium.com

My good name is Saurabh Tripathi and I am back with another interesting finding.

Saurabhcsec, 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 API endpoint trusted user-supplied folder and company identifiers without checking that the authenticated user had authority over them, and it completed the linking action before an unrelated server error occurred.

Impact

An attacker could link files across organisational boundaries, potentially exposing sensitive files or planting malicious files in another company's folder; the text notes the IDs were sequential, increasing the impact.

What the attacker needed

Two accounts on the platform; ability to intercept and modify API requests; knowledge of target folder and company IDs

The fix

The issue was fixed the same day, presumably by adding an ownership check on the referenced folder and company IDs and ensuring failed requests do not partially complete.

How it was found

  1. Log into Account B and upload a test file to a folder, noting the file identifier.
  2. Capture the POST request that links the file to the folder in Account B.
  3. Change the folder ID and company ID in the request to those belonging to Account A, keeping the same file identifier.
  4. Send the modified request; the server returns a 500 Internal Server Error.
  5. Log into Account A and open the target folder to confirm the file from Account B is now present.

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.

A web application lets users upload files and put them into folders. Each folder and company has an ID number. The server should check that the person making a request actually owns the folder they are putting a file into. Here it did not check, so someone from one company could put their file into another company's folder just by changing the ID numbers in the request.

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 saurabhcsec

View all

1 more disclosed report, 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.