Concept
User-to-User Access
User-to-user access describes the case where two users have the same privilege level, but one can access resources belonging to the other.
No admin or higher-privilege role is involved. Both users may be ordinary, fully authenticated accounts:
Logged in as user 4521:
GET /api/messages/inbox
→ own inbox → allowed ✓
GET /api/messages/4522
→ another user's messages → should be denied ✗A vulnerable server might perform only the authentication check:
Is user 4521 authenticated?
→ Yes ✓
Is user 4521 authorized to access messages for user 4522?
→ Never checked ✗
→ Data returnedThe important distinction is:
Authentication
→ "Is this a valid logged-in user?"
Authorization
→ "Can this user access this specific resource?"Because both accounts have the same role, a role-based check such as:
role == "user"would pass for both users and would not prevent the attack.
The server needs an object-level relationship check:
Requester: user 4521
Resource: messages belonging to 4522
↓
Does user 4521 have permission to access them?
↓
No → 403 / equivalent denialThis is the classic horizontal authorization failure, commonly associated with IDOR and, in API security, BOLA (Broken Object Level Authorization).