Skip to content
IDOR Write-up Intermediate

Injected #1: From API Bugs To File Impersonation Attack

The file management API allowed mass assignment on update, letting an attacker change fields like uploaded_by and fileOnDisk. Combined with missing ownership checks, an attacker could replace a trusted user's file with a malicious one while keeping metadata intact.

medium.com

Published on medium.com

I’m starting a newsletter based on Medium to share some important moments from the ethical hacker’s day-to-day job. Let’s dive in!

Chux, 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

The update endpoint used a rest/spread pattern that copied all user-supplied fields into the database model, and it lacked ownership checks on those fields.

Impact

An attacker could replace a trusted user's file with a malicious one while keeping metadata intact, potentially leading to malware distribution within an organisation.

What the attacker needed

Read/write permissions on files

The fix

The text does not state a fix; the company acknowledged the mass assignment bug but refused to acknowledge the broken access control issue.

How it was found

  1. Send a POST request to import a file with a remote address.
  2. Observe the large JSON response containing fields like file_id, fileOnDisk, uploaded_by, and creation_time.
  3. Send a PATCH request to the file endpoint with extra fields such as fileOnDisk and uploaded_by.
  4. Notice that the server accepts and applies these changes.

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.

The app let users edit file details, but it also accepted extra hidden fields that should never be changed, like who owns the file and where it is stored. Because the app did not check if the user really owned the file, an attacker could make their own malicious file look like it belonged to someone else.

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.