IDOR as ID Swap
Change the ID in path/query/body — server must still refuse. Lab :8815.
Visual · api_idor_swap
IDOR is the classic ID swap. Original Cyberlium.
One digit change is enough when checks are missing.
Insecure Direct Object Reference is the older name for guessing or swapping IDs. On YOUR lab, compare /users/1/inbox vs /users/2/inbox with the same token.
1. Where IDs hide
Path (/users/2), query (?id=2), JSON body, headers. All need checks.
UUIDs reduce guessing but do not replace authorization.
Command guide
Try these commands — Where IDs hide
═══ TOOLS & WEBSITES ═══ Browse / read these (authorized learning only — stay in YOUR lab / program scope)
IDOR patterns — https://owasp.org/www-project-web-security-testing-guide/latest/4-Web_Application_Security_Testing/05-Authorization_Testing/04-Testing_for_Insecure_Direct_Object_References API1 BOLA — https://owasp.org/API-Security/editions/2023/en/0xa1-broken-object-level-authorization/
═══ INSTALL ═══
Linux (Debian/Ubuntu):
Command — copy this
sudo apt install curl sudo apt install jq
macOS:
Command — copy this
brew install jq
Windows: Built-in (PowerShell: Invoke-WebRequest)
Command — copy this
choco install jq
═══ LINUX / macOS ═══
Command — copy this
curl -sS -H "Authorization: Bearer userA" "http://127.0.0.1:8815/users/1/profile" | jq '.id // .userId // .'
curl -sS -o /dev/null -w "userA reads userB inbox %{http_code}
" -H "Authorization: Bearer userA" "http://127.0.0.1:8815/users/2/inbox"Primary tools to practice this lesson: curl, jq. Reference sites: IDOR patterns (https://owasp.org/www-project-web-security-testing-guide/latest/4-Web_Application_Security_Testing/05-Authorization_Testing/04-Testing_for_Insecure_Direct_Object_References); API1 BOLA (https://owasp.org/API-Security/editions/2023/en/0xa1-broken-object-level-authorization/). Run every command in the box — install first, then the usage lines — only on YOUR lab / program scope.
2. Lab swap
With userA token, access userA object (expect allow) and userB object (expect deny).
Record status codes.
3. Report language
“Authenticated user can read peer objects by ID” — not “API hacked.”
Include request/response evidence from YOUR lab only.
4. What you ship: ID swap transcript
Allow vs deny status codes on YOUR lab.
5. What you record before the next lesson
Two curls + statuses. Redacted tokens.
6. Wrong vs right: stranger APIs vs literacy on systems you own
Worked failure — same API word, opposite target. Right never needs a live shop or classmate token.
- Wrong: Swap IDs on a production medical API.
- Right: Lab swap only. Next: server checks.
Mission: ID swap on lab
1) Allow on own ID. 2) Deny on peer ID. 3) Write finding sentence.
Stuck? Ask Cyberlium AI Mentor
Ask Mentor: “Does UUID remove BOLA?”
APPLY: UUID alone:
APPLY: True or False: Only path IDs need checks.
APPLY: Expected peer access:
Server-Side Ownership Checks
Part of API Security with AI — BOLA and IDOR.
BOLA Lab — Allow vs Deny
Part of API Security with AI — BOLA and IDOR.
Quiz — BOLA and IDOR
Part of API Security with AI — BOLA and IDOR.