IDOR Lab: Read Someone Else’s Document by Changing One Number

✨ AI Summary
DocuShare checks that you are logged in. It does not check that the document you are opening is yours. Your files have IDs like 1010 and 1011, and the address bar shows them. What happens if you type a smaller number? This is IDOR, and it needs no special tools, just curiosity and a willingness to change a number.
Lab at a glance: Beginner · 60 XP · about 10 minutes · runs in your browser, no signup or setup. Try it yourself first; the full solution is behind a spoiler below.

What this lab teaches

Insecure Direct Object Reference (IDOR) is an access-control bug. The application uses an identifier you can see and change, such as a number in the URL, to fetch a record, and it never checks whether you are allowed to see that record.

The key lesson: authentication (who are you?) is not authorisation (are you allowed to do this?). DocuShare does the first and skips the second.

How DocuShare loads documents

You are logged in as Sarah, user 42. Your documents have IDs from 1010 upward, and the app opens a document from a doc parameter. The server confirms you have a session, then returns whatever document matches the ID. The lab is solved when you open the administrator’s confidential document.

The attack approach

  • Open one of your own documents and note how its ID appears in the request.
  • Notice the IDs are sequential. Predictable numbers mean other users’ documents are nearby.
  • Change the ID to a lower number and see whether the server refuses or hands it over.
  • Keep going until you find a document that belongs to the admin.

Full walkthrough (spoiler)

Stuck after a few attempts? Open the steps below. Solving it yourself first is worth more XP, and more learning.

Show the step-by-step solution
  1. Open one of Sarah’s documents and look at the document ID it uses.
  2. Use the helper input below the document list to request a lower document number.
  3. Work down the range. The server returns other users’ documents without complaint, because it only checks that you are logged in.
  4. Open the document with ID 1003, the admin’s confidential file. The lab detects it and marks you solved.

Why it works

The server trusts the ID you send. Its only check is “is there a valid session?”, and you have one. Nothing compares the document’s owner with the user asking for it. Sequential IDs make the gap easy to find, but they are not the root cause: even random IDs would leak the moment one appeared in a shared link or a log.

Core principleCheck ownership on the server for every object, every time. Never trust an ID just because the user sent it.

Where this happens in the real world

In 2019 First American Financial exposed around 885 million mortgage-related records, including bank details and Social Security numbers, because documents were served from URLs with sequential numbers and no access check. IDOR falls under Broken Access Control, which is number one in the OWASP Top 10 (2021), and it is one of the most common findings in bug bounty programmes, especially in APIs.

How to defend against it

  • Authorise every request on the server. Load the object, then confirm the current user owns it or has been granted access.
  • Centralise the check in one place, such as a policy layer, so new endpoints cannot forget it.
  • Use unguessable IDs (UUIDs) to reduce discovery, but treat this as a speed bump, not a fix.
  • Test with two accounts. Swapping IDs between a user A and user B session is the fastest way to find IDOR in your own app.
Mr Elite tip: When testing real apps you are authorised to test, create two accounts and try to reach account B's data from account A. Check every ID you see: in URLs, in JSON bodies, in headers and in file names.

Try it, then go further

Reading about it is the easy part. Open the lab, try your own approach before peeking at the spoiler, and see how many attempts it takes.

❓ Frequently asked questions

What is an IDOR vulnerability?
An access-control bug where an application uses a user-supplied identifier to fetch data without checking that the user is allowed to access it, so changing the ID exposes other users' data.
Do random IDs fix IDOR?
No. They make IDs harder to guess, but IDs leak through links, logs and other responses. The fix is a server-side ownership check on every request.
Is IDOR the same as broken access control?
IDOR is one type of broken access control, which is ranked first in the OWASP Top 10 (2021).
How do I find IDOR in an app?
With permission, use two accounts and try to read or change one account's objects while logged in as the other, checking every ID the app uses.
⚡
Join free to earn XP for reading this article Track your progress, build streaks and compete on the leaderboard.
Join Free
Lokesh N. Singh aka Mr Elite
Lokesh N. Singh aka Mr Elite
Founder, Securityelites · AI Red Team Educator
Founder of Securityelites and creator of the SE-ARTCP credential. Working penetration tester focused on AI red team, prompt injection research, and LLM security education.
About Lokesh ->

Leave a Comment

Your email address will not be published. Required fields are marked *