IDOR
Source-reviewed labOne valid login. Three account records. A profile ID that the server accepts without asking whether it belongs to you. Authentication works; object-level authorization is missing.
- 1. Establish identity
john → session user_id = 1The supplied login creates a server-side session. - 2. Choose an object
profile.php?id=3The URL selects a different account record. - 3. Missing permission gate
viewer ID ≠ requested IDNothing rejects the cross-account lookup. - 4. Disclose the record
admin profile + flagThe viewer remains John, even while reading admin data.
The scenario
Acme Corp's Customer Portal lets employees log in and read their account details. The intended starting account is john, and a successful login redirects to profile.php?id=1. The profile contains an account ID, username, email, and account type.
The vulnerable endpoint only checks whether a session exists. It then looks up whichever positive numeric ID came from the URL. Changing the reference from John's record to Jane's or the admin's crosses an account boundary without changing the login.
What was reviewed—and what was not run
The PHP, CSS, Docker configuration, README, hidden text clues, and an existing text extraction of the two-page PDF were read. No PHP file, initializer, build script, container, lab, or HTML page was executed or opened in a browser. All outcomes below are source-derived, not captured HTTP responses.
Your starting point
Username: john
Password: password123
Documented lab address: http://localhost:8080These are intentionally published training credentials. You do not need the admin password, a forged session cookie, SQL injection, or a brute-force tool to understand this solve.
What a complete solve means
- Identify the requested object: a row in the
userstable. - Show where the URL's
idreaches the database lookup. - Distinguish the viewer's session identity from the record being displayed.
- Explain why changing
1 → 2exposes another ordinary user's profile. - Explain why changing
1 → 3reveals the seeded flag to John. - Propose server-side authorization and negative regression tests.
The important distinction
Authentication answers “Who is making the request?” Authorization answers “May this user access this particular object?”
The important limit
This endpoint demonstrates unauthorized reads. The supplied code does not establish account takeover, password changes, or admin action access.
Reveal the source-defined flag and target profile
The initializer plants this value on the third account in a freshly created database. It is not printed in the README or the PDF and was not retrieved from a running service here.
FLAG{idor_access_control_failure}The intended target is profile.php?id=3 while authenticated as John (ID 1) or Jane (ID 2). The template hides the flag when the flag owner views their own profile.