Insecure Direct Object Reference (IDOR)

The application uses an identifier supplied by the user to find a record or file without checking that the user may access that particular object.

SeverityHigh
CVSS 3.17.1 CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:N Open in the calculator
CVSS 4.07.1 CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N Open in the calculator
CWECWE-639: Authorization Bypass Through User-Controlled Key
OWASP Top 10A01:2025 Broken Access Control
MITRE ATT&CKT1190 Exploit Public-Facing Application
CategoryBroken Access Control

Description

The application locates records or files using an identifier supplied in the request, such as a number in the path (/invoices/10452), a query parameter, a form field or a value in a JSON body, and returns or changes the object without checking that the signed-in user is entitled to that particular object. Authentication is in place, but authorisation at the level of the individual object is missing.

Changing the identifier to another valid value therefore gives access to another user's data. An attacker holding any valid account can read other users' records, such as personal details, invoices, messages or documents and, where the same pattern applies to update and delete operations, change or remove them, which can extend to taking over accounts by changing another user's email address. Sequential or predictable identifiers make enumeration trivial, so the whole data set can be harvested with a simple script. Random identifiers such as UUIDs make objects harder to find but do not fix the missing check, since identifiers also appear in links, shared documents, logs and other responses. The impact is greatest where the flaw crosses tenant boundaries or covers sensitive personal or financial data, and an exposure of personal data at that scale may also create regulatory obligations for the organisation.

The weakness is identified by testing with at least two accounts, ideally in different roles and, for multi-tenant services, in different tenants: identifiers belonging to one account are substituted into the requests of the other, for reads, updates, deletions and file downloads, including identifiers in nested objects and secondary parameters. Burp Suite extensions such as Autorize help to replay requests across sessions. Automated scanners rarely find the issue, because they cannot tell which user should own which object.

Remediation

Check, on the server, that the signed-in user may access the specific object in every request that references one:

  • Scope every data access by the identity held in the server-side session, not by an identifier the client sends. For example, look up an invoice by its identifier and the current user's customer identifier together, and return 404 when no row matches.
  • Implement the check once, in a shared data access layer, policy or middleware that every endpoint uses, and deny access by default when no rule grants it.
  • Where users only ever need their own records, take the owner from the session (/account/invoices) rather than from the address (/users/123/invoices).
  • Apply the same check to file downloads, exports and every HTTP method on the resource.
  • Use random, non-sequential identifiers as defence in depth, never as the control.
  • Add automated tests that attempt cross-user and cross-tenant access for each endpoint, so regressions are caught.
-- Unsafe: trusts the identifier alone SELECT * FROM invoices WHERE id = ? -- Safe: scoped to the customer in the session SELECT * FROM invoices WHERE id = ? AND customer_id = ?

Confirm the fix by repeating the tests with two accounts: requests for another user's objects should be refused, and the refusals should be logged.

References


Add This Finding to Your Library

In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.

Free trial  ·  No card required

Only need the reporting? Our reporting tool is free and open source, with the same library.


More Web Applications Findings

Every Web Applications finding