Skip to content
IDOR Write-up Beginner

Unauthenticated Upload, Unauthenticated Read: How I Wrote Prescri

An unauthenticated API endpoint allowed uploading files to any patient's record by changing a numeric identifier, and the uploaded files could be read back without authentication from a public storage path. An attacker could inject fabricated prescription documents into real patient records and read any uploaded file.

Sarthak Chauhan Follow

Published on medium.com

An API endpoint used to upload patient prescription documents had no authentication at all. By changing a single numeric parameter in the request, I could upload arbitrary files into any patient’s medical record — and read them straight back from a public storage path, also with zero credentials.

Sarthak Chauhan, 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 upload route bypassed the shared authentication middleware layer due to a routing configuration gap, and file storage was publicly accessible without authorization checks.

Impact

An attacker could inject fabricated prescription documents into any patient's record and read any uploaded file, posing patient safety and confidentiality risks; the text does not mention any defence that limited the exploit.

What the attacker needed

No account needed; Knowledge of patient identifier; Network access to the API

The fix

The organization added authentication to the upload endpoint, enforced authorization so requests can only act on the requesting user's own records, and moved file storage behind an authenticated access path.

How it was found

  1. Send an unauthenticated POST request to the upload endpoint with a test patient identifier and a dummy PDF file.
  2. Repeat the upload with a different test patient identifier, still without credentials.
  3. Download both uploaded files from the public storage path without authentication.
  4. Repeat uploads against several low, sequential test identifiers to confirm the issue was not specific to two identifiers.

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.

This report describes a healthcare app's API where a file upload feature had no login check. Anyone could send a file to any patient's record by changing a number in the request, and then download files from a public web address without logging in. This could let an attacker add fake prescriptions to someone's medical record or read other people's uploaded documents.

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.