I Changed One Number… and Got Access to Citizens’ ID and Address Proofs
A government web application fetched uploaded identity documents using a sequential numeric ID parameter without checking whether the document belonged to the requesting user. An attacker could change the ID to retrieve other citizens' ID proofs and address verification documents.
infosecwriteups.com
Published on infosecwriteups.com
While exploring a state government web application, I came across a feature where users could apply for a service and upload supporting documents. Pretty standard flow:
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 document retrieval endpoint used a predictable sequential ID and returned the file whenever the ID existed, without verifying that the document belonged to the authenticated user.
Impact
Sensitive government-issued ID proofs and address verification documents of other citizens could be accessed, creating risks of identity theft, fraud and mass data scraping.
What the attacker needed
A user account on the portal; ability to upload documents; victim has uploaded documents
The fix
The issue was acknowledged and fixed after responsible disclosure.
How it was found
- Submit an application and upload ID and address proof documents through the portal.
- Observe the request that fetches a document, which includes a numeric id parameter.
- Change the id value to a different number and send the request.
- Receive another user's uploaded document in the response.
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.
When you upload a document to a website, the site usually gives it a reference number. If the site lets you fetch any document just by changing that number, and never checks that the document is yours, you can read other people's private files. This is called an insecure direct object reference (IDOR): the site trusts the number instead of checking who you are.
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.