pentesting, updated
Testing for insecure direct object references
Check whether swapping an ID in a request reveals or modifies another user's resource.
Goal
Confirm every object-referencing endpoint checks that the authenticated user actually owns or may access that object.
How to test
As an authenticated low-privilege user, swap the ID in every request that references “your own” resource:
curl -s https://example.com/api/invoices/1001 -H "Cookie: session=<your-session>" # yours
curl -s https://example.com/api/invoices/1002 -H "Cookie: session=<your-session>" # someone else's
Test IDs in URLs, query strings, JSON bodies and headers alike — and don’t stop at GET: try the same swap on PUT/PATCH/DELETE.
What to look for
Another user’s object returned, modified or deleted using only your own, lower-privileged session.
Notes
This is the single highest-yield check in most web APIs — go through it systematically for every object type the app exposes, not just the obvious ones.
References
- OWASP WSTG-ATHZ-04 — Testing for Insecure Direct Object References.