# IDOR Cheat Sheet

> An insecure direct object reference (IDOR) lets someone read or change a record outside their permissions. Compare the access policy with the observed result for the same record and action.

Source: https://payloadplayground.com/cheatsheets/idor

For authorized security testing only.

## Reference questions

### Does switching to UUIDs fix an IDOR?

A random UUID makes a record harder to guess. The server still needs to check the signed-in user’s permission for that record and action. For an owner-only record, limit the database lookup to records owned by the current user. For shared records, also apply the sharing policy.

### What evidence belongs in an object-access finding?

Record the intended policy, the test account’s role, its relationship to the record, the requested action and the observed result. A 200 response can contain a sign-in screen or a denial. Record whether protected data was returned or a change actually took effect, using redacted evidence from test records.

## Sequential ID Enumeration

- `/api/users/1, /api/users/2, /api/users/3...` — Increment integer IDs
- `/api/orders/1000 → /api/orders/999` — Decrement to find other records
- `/api/invoice?id=100&id=101&id=102` — Parameter array for batch access
- `Change user_id in request body from own ID to target ID` — Body parameter tampering

## UUID / Non-Sequential

- `Try UUID v1 — timestamp-based, predictable` — UUIDv1 timestamp prediction
- `Search for UUIDs in other API responses, JS files, error messages` — UUID leakage in responses
- `00000000-0000-0000-0000-000000000000` — Null UUID test
- `Change one character of known UUID` — Adjacent UUID guessing

## Encoded ID Tampering

- `Base64 decode ID → modify → re-encode` — Base64 encoded ID manipulation
- `Hex decode ID → modify → re-encode` — Hex encoded ID manipulation
- `MD5/SHA hash of sequential integers` — Hashed ID prediction
- `JWT payload sub claim modification` — JWT-based IDOR

## HTTP Parameter Pollution

- `?user_id=123&user_id=456` — Duplicate parameter — server may use last
- `?user_id[]=123&user_id[]=456` — Array parameter injection
- `Change GET param and POST body to different IDs` — Method-specific parameter priority
- `X-Original-URL: /api/admin/users/1` — URL override header IDOR

## Related

- [Pentest Workspace](https://payloadplayground.com/tools/pentest-workspace)
- [JWT Attacks Cheat Sheet](https://payloadplayground.com/cheatsheets/jwt-attacks.md)
- [CSRF Cheat Sheet](https://payloadplayground.com/cheatsheets/csrf.md)
