How a Simple IDOR that causes PII Disclosure
A password reset API accepted a base64-encoded user ID and returned another user's email, first name and last name without checking ownership. An attacker could enumerate user IDs to disclose personal information of arbitrary users.
medium.com
Published on medium.com
Greetings Everyone! Today I found one of theOWASP Top 10 security vulnerabilitycalled IDORwhich leads to PII disclosure in one of the famous shopping comparison webapp[I’m not supposed to say the name of the site]
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 password reset endpoint trusted a client-supplied, merely base64-encoded user identifier and returned user data without verifying that the requester was authorised for that user.
Impact
An attacker could disclose the email, first name and last name of arbitrary users, and the author suggests this could give a clue for account takeover by brute forcing.
What the attacker needed
A valid account to start password reset; access to the reset email link; ability to decode and encode base64
The fix
The endpoint should verify that the authenticated user owns the account referenced by the identifier, and should not rely on base64 encoding as a security control.
How it was found
- Click the forgot password link.
- Enter an existing account and send the password reset mail.
- Open the reset password link from the email.
- In the developer console, capture the API request containing the base64 value.
- Decode the base64 value to obtain a user ID.
- Encode a different user ID and pass it in the API request to see another user's details.
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 reset a password, the site puts a hidden identifier in the link that tells it which account to reset. Here that identifier was just a number encoded in base64, which is a simple encoding, not encryption, so anyone can decode it and change the number. The site then showed the personal details of whichever account the changed number pointed to, without checking that the person asking owned that account.
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.