Api Authentication Bypass On National Informatics Centre
An API endpoint accepted a user-supplied userid parameter without checking that it belonged to the caller, so changing it returned other users' full records. An attacker could enumerate IDs to harvest personal details, password hashes and tokens.
Published on infosecwriteups.com
Hey Hackers!!! My name is Krishnadev P Melevila.
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 endpoint looked up records by the client-supplied userid without verifying it matched the authenticated session.
Impact
An attacker could retrieve other users' education details, phone numbers, encrypted passwords and tokens, and by iterating IDs could collect the whole user base.
What the attacker needed
A free account; reach the fourth application step; intercept the request
The fix
The endpoint was fixed so that it no longer returns other users' records when the userid is changed.
How it was found
- Start the internship application and reach the fourth step.
- Intercept the request sent to the userdetails endpoint.
- Change the userid parameter to a different value.
- Observe that another user's full record is returned.
- Use an automation tool to iterate over userid values and collect many records.
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 website often uses a number to identify your account. If the server trusts whatever number you send instead of checking it belongs to you, you can swap it for someone else's and read their data. This is called an insecure direct object reference (IDOR).
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.