labs / idor

IDOR / Access Control

Read a note that isn't yours by tampering with an object id, no ownership check in sight.

Broken Access Control Beginner Server lab
leaderboard →
    Objective Find another user's note and submit the recovery code it contains.

    Signed in as: you — your notes

    • #1001 — Shopping list
    • #1002 — Standup notes

    The viewer below loads a note by its id. It checks that you're logged in… but does it check that the note is yours? Your ids are nearby. What about the ones in between?

    How the fix works

    Authentication answers "who are you?"; authorization answers "are you allowed to touch this?" The endpoint did the first and skipped the second. The fix: on every object fetch, verify the current user owns (or may access) that specific object — WHERE id = ? AND owner = ?.

    $ patch ./idor

    You broke it — now fix it. Which change enforces access control?

    SELECT * FROM notes WHERE id = :id;  -- returns any note