Diagnostic playbook
Broken access control / IDOR on user management API (update any user, list all users)
Web / Broken Access Control / IDOR
Knowledge identity
Definition and taxonomy
Summary
JSON endpoints that manage user records do not enforce object-level or function-level authorization consistently: a low-privileged user can read the full user table and modify any user's record by guessing/providing a user_id.
Severity rationale
Demonstrated as a non-admin user (gordonb) retrieving the full user list and updating any user (including admin, id=1) via JSON API endpoints. High level blocks the data-listing endpoint but still permits the update endpoint for any user_id. Updates were performed as no-op idempotent writes; seeded data verified unchanged.
Aliases
IDOR, insecure direct object reference, function-level access control failure, authorization bypass
Standards
CWE-639,CWE-862 CAPEC-104 A01:2021-Broken Access Control
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N
1. First Signal
What should make an agent suspicious
Symptoms
A non-admin session receives the full user list or an 'ok' result when updating another user's record; sibling endpoints enforce different authorization (data listing blocked at high but update still allowed).
Prerequisites
Authorized lab session with a non-admin account; the caller can reach the endpoints; user_id of the target is guessable/enumerable (small integers).
2. Recognition Logic
How to recognize this next time
If a JSON API takes a numeric id and returns/modifies records, test it from a low-privileged session. Check each endpoint separately - one may enforce a role check while a sibling does not.
3. Diagnostic Procedure
Safe checks, in order
- Confirm authorized scope. 2. Create/use a non-admin account. 3. Call the list endpoint and the update endpoint with the target's id. 4. Use a no-op idempotent write so seeded data is unchanged. 5. Verify data is intact afterwards. 6. Record which endpoints enforce the admin check at each level.
4. Proof
Evidence
DVWA authbypass as gordonb: get_user_data.php returned all 5 users at low and medium (Access denied at high); change_user_details.php returned {"result":"ok"} for admin id=1 at low, medium, and high; admin row verified unchanged afterward.
5. Controls
Negative checks
get_user_data.php denied access at high (control); at impossible level change_user_details.php also denies non-admin; no-op writes confirmed data integrity.
6. Avoid Bad Memory
False positives and traps
Reading your own record is not IDOR; the flaw is accessing/modifying records you do not own. A 403 on one endpoint does not mean all endpoints are protected.
7. Why It Matters
Impact
Any authenticated user can enumerate and modify all users, including administrators, enabling privilege escalation and account tampering.
8. Why It Happened
Root cause
Authorization checks are applied inconsistently: the page gates on role, get_user_data.php gates only at high/impossible, and change_user_details.php gates only at impossible; object-level ownership is never checked.
9. Fix
Remediation and prevention
Enforce authorization server-side on every endpoint and every object access. Use ownership checks and server-derived user identity. Centralize authorization logic instead of duplicating inconsistent checks.
10. Re-test
Verification steps
- After fix, call both endpoints as a non-admin and confirm denial. 2. Confirm a non-admin cannot update admin's record. 3. Confirm data integrity. 4. Regression tests per endpoint.
Reference
Tools and sources
Tools used
curl for JSON API calls, docker exec for read-only source review and DB verification
References
OWASP Broken Access Control; CWE-639; CWE-862
Intelligence
Products and history
Technologies
PHP, JSON API, Apache
Affected products / versions
DVWA (Damn Vulnerable Web Application) current master
History
First documented in DVWA authbypass module in the 2026-08 benchmark run.
Exploit knowledge
Variants and references
Attack surface
GET get_user_data.php (list users) and POST change_user_details.php (update a user by id) JSON endpoints
Exploit maturity
proof-of-concept
Known variants
Data listing exposed at low/medium, update-by-id exposed at low/medium/high (blocked only at impossible), per-object authorization missing on the update endpoint
Defensive signatures
Authenticated JSON endpoints returning other users' records, requests that succeed on arbitrary user_id values regardless of the caller's role, inconsistent authorization checks across sibling endpoints
Reproduction commands
Login as a non-admin (gordonb/abc123) in a separate cookie jar, set security cookie to low/medium/high, then: get_user_data: curl -s -b $GJAR http://127.0.0.1:4280/vulnerabilities/authbypass/get_user_data.php change_user_details (no-op on admin id=1): curl -s -b $GJAR -H "Content-Type: application/json" -d '{"id":1,"first_name":"admin","surname":"admin"}' http://127.0.0.1:4280/vulnerabilities/authbypass/change_user_details.php
Exploit references
No external references stored; all evidence from the authorized local lab.
Case provenance