How I Stopped A Data Breach In 2 Minutes: A Lesson on Insecure Direct Object References (IDOR)
A receipt PDF endpoint used a predictable integer ID and a Base64-encoded version of that ID as parameters, without checking whether the requesting user was authorised to view the receipt. An attacker could increment the ID and re-encode it to access other users' receipts, exposing names, phone numbers, payment amounts and methods for approximately two million records.
Published on infosecwriteups.com
The URL was a direct link to a receipt PDF on a web app, and it had two parameters: an integer ID and an encoded string. Immediately, my curiosity was piqued, and I wondered whether the encoded text might just be a slightly hidden identifier — something that could potentially lead to accessing unauthorized data.
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 application used predictable, user-controlled identifiers (an integer and its Base64 encoding) to reference receipts and failed to verify that the authenticated user owned the requested receipt.
Impact
An attacker could access approximately two million users' receipts, exposing full names, phone numbers, payment amounts and dates, payment methods, and other business-related information; no credit card numbers were exposed, and no rate limiting was in place to limit the attack.
What the attacker needed
A valid receipt URL; no special account needed
The fix
The endpoint should enforce proper authorization checks so that each request validates the user's identity and confirms they are authorised to view the requested receipt, and should use unpredictable identifiers and rate limiting.
How it was found
- The author examined the URL structure and noticed two parameters: an integer receipt_id and an encoded string receipt_encoded.
- The author tested whether receipt_encoded was simply the receipt_id encoded in Base64 URL format without padding, and confirmed this.
- The author incremented the receipt_id and updated receipt_encoded accordingly, then requested the URL and received another user's receipt PDF.
- The author wrote a Python script to automate requests over a range of IDs and check for rate limiting, finding approximately two million accessible records and no rate limiting.
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.
An IDOR (Insecure Direct Object Reference) happens when a website lets you access something by changing a number or code in the URL, without checking if you are allowed to see it. Here, the receipt number was a simple counting number, and a second code was just that number written in a different format. By changing the number and updating the code, the author could view anyone's receipt.
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.