“The Day I Stumbled Upon an Invisible Backdoor: Exploiting File Downloads via IDOR”
The file download endpoint used a sequential numeric file identifier and did not check that the requesting user owned the file. An attacker could change the identifier to download other users' invoices, contracts and reports.
medium.com
Published on medium.com
It was a routine pentest. The client, a mid-sized SaaS company, had an internal portal where employees could upload and download files — invoices, receipts, contracts.
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 server used predictable sequential file identifiers and never verified that the requesting user owned or was allowed to access the requested file.
Impact
An attacker could download all user files across the platform, leading to data exfiltration, leaks, extortion and regulatory fines.
What the attacker needed
A user account on the portal; ability to intercept HTTP requests
The fix
The report recommends enforcing ownership checks on every file request, using non-guessable identifiers, applying role-based access control, adding rate limiting and monitoring, and encrypting stored files.
How it was found
- Upload a harmless PDF and intercept the download request.
- Note the numeric file_id parameter in the download request.
- Change the file_id to a different number and send the request.
- Observe that a file belonging to another user is returned.
- Automate enumeration of file_id values to download many files.
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 file download link used a simple number to say which file to fetch, like a locker number. The server handed over whatever file matched the number without checking whether the person asking was allowed to see it. By changing the number, the tester could open other people's private 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.