Category: API Security

  • What Is IDOR? Insecure Direct Object Reference Explained with Real Examples

    IDOR is one of the most common security bugs we find when testing web applications and APIs. It is simple to understand, often easy to exploit, and it can expose the private data of every user on a platform. In this guide we explain what an IDOR vulnerability is, how attackers find it, real examples, and how developers can fix it for good.

    What is IDOR?

    IDOR stands for Insecure Direct Object Reference. It happens when an application uses an ID that the user can change (such as an invoice number, user ID or file name) to fetch data, but never checks whether that user is actually allowed to see or change that data.

    Think of a hotel where every room key opens any door, as long as you know the room number. You only booked room 101, but nothing stops you from walking into room 102. That is IDOR.

    IDOR is part of Broken Access Control, which is ranked A01 in the OWASP Top 10:2025. In APIs the same problem is called BOLA (Broken Object Level Authorization) and it is number one in the OWASP API Security Top 10 (2023). You can read our simple guide to all ten categories in OWASP Top 10 (2025) explained.

    A simple IDOR example

    You log in to an online store and open your latest invoice. The address bar shows:

    https://shop.example.com/invoice?id=1001

    Out of curiosity you change 1001 to 1002 and press Enter. The page now shows another customer's name, address, phone number and order details. The application checked that you were logged in, but it never checked that invoice 1002 belongs to you. Every invoice in the system is now readable by anyone with an account.

    Where IDOR vulnerabilities hide

    IDs are not always in the address bar. During a penetration test we look for object references in every part of a request:

    • URL parameters: /profile?user_id=482
    • API paths: /api/v1/users/482/orders
    • JSON request bodies: {"account_id": 482, "amount": 500}
    • File downloads: /download?file=salary_slip_482.pdf
    • GraphQL queries: query { order(id: 9001) { address phone } }
    • Hidden form fields, cookies and headers
    • Mobile and desktop apps that call the same backend APIs

    Types of IDOR

    • Read IDOR: you can view data that belongs to someone else, such as invoices, chats, medical reports or ID documents.
    • Write IDOR: you can change someone else's data, for example updating another user's email address or shipping address.
    • Delete IDOR: you can delete other users' records, files or comments.
    • Function level issues: a normal user can call an admin action by changing an ID or role value. In APIs this is called BFLA (Broken Function Level Authorization).

    Write IDOR is often the most dangerous. If an attacker can change the email address on someone else's account, they can trigger a password reset and take over that account completely.

    Why IDOR happens

    Most IDOR bugs come from one wrong assumption: "the user is logged in, so the request must be fine." Being logged in (authentication) only proves who you are. It does not prove you own the object you are asking for (authorization). When the server trusts the ID sent by the browser or the app without checking ownership, IDOR appears.

    It is also easy to miss in code review. One endpoint may have the check and the very next one may not, especially when new features are added quickly.

    How security testers find IDOR

    Automated scanners rarely find IDOR because they do not understand who owns what. It needs manual testing. This is the approach we follow, and only ever on applications we have written permission to test:

    1. Create two test accounts (User A and User B) with different data.
    2. Log in as User A and capture every request with Burp Suite or a similar proxy.
    3. Note every ID in the requests: numbers, UUIDs, file names and encoded values.
    4. Replay User A's requests using User B's session, or swap in User B's IDs.
    5. Test every method, not just GET. Try PUT, PATCH, POST and DELETE on the same object.
    6. Decode values that look random. Base64 or hashed IDs are often still predictable.
    7. Compare the responses. Any data from the other account means the check is missing.

    Burp Suite extensions such as Autorize help by replaying requests with a second session automatically. Our API security testing checklist covers BOLA and BFLA tests in more detail.

    Important: testing someone else's application without written permission is illegal in India under the IT Act, 2000, and in most other countries. Practice on intentionally vulnerable labs instead.

    How to fix and prevent IDOR

    • Check ownership on the server for every request. Before returning or changing an object, confirm it belongs to the logged in user or that their role allows it.
    • Take the user from the session, not the request. Use the identity in the session or token instead of trusting a user_id sent by the client.
    • Deny by default. If no rule clearly allows the action, block it.
    • Centralise authorization. Put access checks in shared middleware or a policy layer so new endpoints cannot skip them.
    • Use random IDs as an extra layer only. UUIDs make guessing harder, but they are not a fix. IDs leak through emails, logs and shared links.
    • Write access control tests. Add automated tests that call each endpoint as a different user and expect a 403 or 404.
    • Log and alert on users who request many objects they do not own.

    Quick IDOR checklist for developers

    • Does every endpoint that takes an ID check who owns that object?
    • Are update and delete endpoints protected, not just view pages?
    • Are file download links checked for ownership?
    • Do mobile and desktop app APIs have the same checks as the website?
    • Do you have tests that try to access another user's data?

    Frequently asked questions

    Is IDOR the same as BOLA?

    Yes, they describe the same problem. IDOR is the older name used for web applications. BOLA is the name used in the OWASP API Security Top 10.

    How serious is an IDOR vulnerability?

    It depends on the data. An IDOR that exposes public profile pictures is low risk. One that exposes bank statements, medical records or lets you take over accounts is usually rated high or critical using CVSS.

    Can automated scanners detect IDOR?

    Rarely. Scanners do not know which data belongs to which user, so IDOR is mainly found through manual testing with multiple accounts.

    Get your application tested for IDOR

    At Bugfynd we test web applications, APIs and thick client apps manually, the way a real attacker would, with every finding explained in plain language and a free retest after you fix it. See what you receive in our sample pentest reports, or learn to find bugs like this yourself in our web application pentesting course taught in English and Telugu.

    Questions or a project to discuss? Email contact@bugfynd.com or message us on WhatsApp.

  • API Security Testing Checklist: The OWASP API Top 10 (2023) in Practice

    APIs power almost every modern app — mobile apps, single-page web apps, partner integrations and microservices. They are also a favourite target for attackers, because they often expose data directly and are tested far less than the website in front of them.

    This checklist walks through the OWASP API Security Top 10 (2023) with practical things to test for each risk. For the full 68-point version, see our free API security testing checklist on GitHub.

    Before you start

    • Get written permission and agree the scope — which hosts, API versions and environments (staging is best).
    • Collect the documentation: OpenAPI/Swagger files, Postman collections or the GraphQL schema.
    • Get two test accounts for every role. Most serious API bugs are about one user reaching another user’s data.
    • Route traffic through a proxy such as Burp Suite so you can see and replay every request.

    API1:2023 – Broken Object Level Authorization (BOLA)

    The most common and most damaging API flaw. Test it by logging in as User A, then replaying User A’s requests with User B’s object IDs.

    • Change IDs in the path, query string, JSON body and headers.
    • Try GET, PUT, PATCH and DELETE on other users’ objects.
    • Look for IDs leaked in other responses that make guessing easy.

    API2:2023 – Broken Authentication

    • Check rate limiting on login, OTP and password-reset endpoints.
    • Decode JWTs and test signature validation, the alg: none trick and weak signing secrets.
    • Confirm tokens expire and are invalidated on logout.

    API3:2023 – Broken Object Property Level Authorization

    This combines two older issues: excessive data exposure and mass assignment.

    • Compare API responses with what the app actually displays — are extra fields such as emails, roles or internal IDs returned?
    • Add unexpected fields to update requests, for example "role":"admin" or "balance":99999, and see if they stick.

    API4:2023 – Unrestricted Resource Consumption

    • Request huge page sizes (?limit=100000) and large payloads.
    • Test expensive operations — exports, reports, search — for abuse.
    • Check that SMS and email endpoints cannot be triggered endlessly, which costs real money.

    API5:2023 – Broken Function Level Authorization (BFLA)

    • Call admin endpoints with a normal user’s token.
    • Switch HTTP methods — a read-only GET endpoint may also accept DELETE.
    • Guess admin paths from naming patterns, such as /api/users → /api/admin/users.

    API6:2023 – Unrestricted Access to Sensitive Business Flows

    • Can a script buy all the stock, book every slot or create thousands of accounts?
    • Test coupons, referrals and refunds for automation abuse.

    API7:2023 – Server-Side Request Forgery (SSRF)

    • Find parameters that accept URLs — webhooks, image fetchers, PDF generators.
    • Test whether they can reach internal addresses or cloud metadata services.

    API8:2023 – Security Misconfiguration

    • Review CORS settings, TLS, security headers and verbose error messages.
    • Check for unnecessary HTTP methods and exposed debug endpoints.

    API9:2023 – Improper Inventory Management

    • Look for old API versions (/v1, /beta) that are still live but less protected.
    • Make sure staging and test APIs are not reachable from the internet.

    API10:2023 – Unsafe Consumption of APIs

    • Review how your API trusts data from third-party APIs — is it validated before use?
    • Check that outbound calls use TLS, timeouts and sensible limits.

    Don’t forget GraphQL

    If you use GraphQL, also check whether introspection is enabled in production, whether query depth and batching are limited, and whether every resolver enforces authorization — not just the top-level query.

    Tools that help

    Burp Suite (with extensions such as Autorize), Postman, OWASP ZAP and the API documentation itself are usually enough to start. Tools speed up the work, but the most valuable API findings — especially BOLA and business-logic flaws — come from careful manual testing.

    See how we report API findings in our sample API security reports.


    Need a security test? Bugfynd offers manual web application, API, thick client and source code security testing with CVSS-rated reports and a free retest. Book a free 30-minute consultation or see our sample reports.