Logic Foundry

Build with understanding.

Testing for IDOR Without Guessing IDs: A Two-Account Workflow

In an article published on November 5, 2026, 无颜 described a practical way to test for insecure direct object references (IDOR): create two accounts and use one account’s session to request a resource known to belong to the other. The method replaces guessed IDs with controlled test data, making the result easier to interpret.

A response such as {"status":true,"data":{"address_id":null}} is not enough to establish that an endpoint checks ownership. The ID might not exist, or the request might use the wrong parameter name.

Set up a controlled test

Use only accounts and records you are authorized to test:

  1. Sign in as account A and create a record. Save its ID and confirm that A can retrieve it.
  2. Sign in as account B in a separate browser context or private window. Create a second record so both IDs are known to exist.
  3. With B’s session, request A’s record ID. Keep the method, path and other request fields consistent with a normal request.

Check the normal request first to see where identity comes from. An endpoint may take the session from a cookie and the target record from addrId; another may accept both userId and addrId. In the latter case, the article recommends testing each parameter and their combination. Confirm the actual parameter names from a working request rather than assuming that addrId, addressId and addr_id are interchangeable. Keep the two sessions isolated so cookies do not overwrite one another.

If B receives A’s record, the cross-account read is demonstrated; document the minimal evidence and stop rather than enumerating records. If B receives null or an empty result, do not call the endpoint safe on that response alone. Because A’s record is known to exist, the test rules out a nonexistent ID, but the response still needs to be interpreted in light of the request and application behavior. A 403 before login establishes an access requirement for the endpoint, not necessarily an ownership check for individual records after login.

The article warns against trying adjacent IDs. It notes that systems using Snowflake-style IDs may leave large gaps, so a failed guess is not evidence of authorization. It also advises against looping through large ID ranges: that can breach testing rules, place load on a service and collect data unnecessarily. Its recommendation is to use two controlled accounts and a small number of requests, subject to the applicable authorization and disclosure rules.

The key distinction is between a known existing record that another account can read and an ID that merely returns an empty response. Only the former demonstrates an unauthorized cross-account read.