AI pentesting guides / Vulnerability classes

Access control

IDOR testing

IDOR testing checks whether a user can access another user's data simply by changing an identifier, such as an account number, file name or order ID, in a request the application accepts without verifying ownership. An insecure direct object reference is classified as CWE-639 (Authorization Bypass Through User-Controlled Key) and falls under OWASP Top 10 2021 A01: Broken Access Control.

IDOR is one of the most common high-impact web findings because it requires no exotic payload and is invisible to scanners that test with a single account. Finding it needs two accounts and a methodical approach to every object the application exposes.

Classification

  • CWE-639: Authorization Bypass Through User-Controlled Key (related: CWE-284 Improper Access Control).
  • OWASP Top 10 2021: A01 Broken Access Control.
  • OWASP API Security Top 10 2023: API1 Broken Object Level Authorization, the API name for the same flaw.

How IDOR is found

Create two accounts, A and B, and record every request that carries an identifier: in paths (/invoices/5521), query strings, JSON bodies, headers and cookies. Then replay A's requests with B's identifiers, for reads and also for updates and deletes. Look beyond the obvious: export and download endpoints, file names in storage URLs, IDs inside encoded or signed-looking tokens that are not actually verified, and identifiers in GraphQL arguments. Predictable sequential IDs make exploitation easier, but random IDs only help if they never leak.

What counts as proof

A convincing IDOR finding has three parts: account A's session, a request for an object that belongs to B, and a response containing B's data or confirming the change to B's object. Add a control: the same request with a well-formed ID that does not exist should return 404 or an error. The difference between victim ID and control shows the server found the object and returned it without an ownership check. Use test accounts; avoid accessing real customer data beyond what is needed to prove the point.

Remediation

  • Check ownership or permission on every object access, server-side, using the authenticated identity.
  • Prefer scoped queries (WHERE id = ? AND owner_id = ?) over fetch-then-check, so a missed check fails closed.
  • Centralise authorisation in a policy layer rather than per-handler code.
  • Use unpredictable IDs as defence in depth, not as the control.
  • Add automated tests that call each endpoint with a second user's IDs.
With Pentest-Swarm

How Pentest-Swarm tests for IDOR

IDOR/BOLA is one of the classes Pentest-Swarm proves with a non-LLM oracle rather than a model's judgement.

  • The exploit agent harvests real object IDs during recon and replays them across accounts.
  • A differential oracle compares the victim ID (attack) with a well-formed non-existent ID (control); only a divergent response is badged VERIFIED.
  • Shipped chains on OWASP NodeGoat (/allocations/:id) and VAmPI demonstrate cross-user reads end to end.
  • Findings include the request pair, evidence, severity and CVSS, and a sandboxed Python proof of concept.

Where it falls short

Automated IDOR testing is only as good as the accounts and IDs it has: with a single account, cross-user access can be suspected but not proven. Pentest-Swarm also cannot judge whether a piece of data is sensitive in your business context, and IDORs that require a multi-step workflow to reach may need a manual tester.

Questions

What is the difference between IDOR and BOLA?

They describe the same flaw. IDOR is the older web term; BOLA is the name used in the OWASP API Security Top 10.

Do GUIDs prevent IDOR?

No. Unguessable IDs make blind enumeration harder, but IDs leak through URLs, emails and other responses. Only a server-side authorisation check prevents IDOR.

How severe is an IDOR?

It depends on the data and action. Reading another user's profile picture may be low; reading or changing financial or health records is typically high or critical.

Sources

  1. CWE-639
  2. OWASP A01:2021 Broken Access Control
  3. OWASP IDOR Prevention Cheat Sheet