<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Bugfynd</title>
    <description>The latest articles on DEV Community by Bugfynd (@bugfynd).</description>
    <link>https://dev.to/bugfynd</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4267203%2F1c41c763-e229-4f25-a440-459b1e435772.png</url>
      <title>DEV Community: Bugfynd</title>
      <link>https://dev.to/bugfynd</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bugfynd"/>
    <language>en</language>
    <item>
      <title>What Is IDOR? Insecure Direct Object Reference Explained with Real Examples</title>
      <dc:creator>Bugfynd</dc:creator>
      <pubDate>Thu, 26 Nov 2026 15:12:56 +0000</pubDate>
      <link>https://dev.to/bugfynd/what-is-idor-insecure-direct-object-reference-explained-with-real-examples-3g5n</link>
      <guid>https://dev.to/bugfynd/what-is-idor-insecure-direct-object-reference-explained-with-real-examples-3g5n</guid>
      <description>&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is IDOR?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;IDOR stands for Insecure Direct Object Reference.&lt;/strong&gt; 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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;IDOR is part of &lt;strong&gt;Broken Access Control&lt;/strong&gt;, which is ranked &lt;a href="https://owasp.org/Top10/2025/" rel="noopener noreferrer"&gt;A01 in the OWASP Top 10:2025&lt;/a&gt;. In APIs the same problem is called &lt;strong&gt;BOLA (Broken Object Level Authorization)&lt;/strong&gt; and it is number one in the &lt;a href="https://owasp.org/API-Security/editions/2023/en/0x11-t10/" rel="noopener noreferrer"&gt;OWASP API Security Top 10 (2023)&lt;/a&gt;. You can read our simple guide to all ten categories in &lt;a href="https://bugfynd.com/owasp-top-10-2025-explained/" rel="noopener noreferrer"&gt;OWASP Top 10 (2025) explained&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  A simple IDOR example
&lt;/h2&gt;

&lt;p&gt;You log in to an online store and open your latest invoice. The address bar shows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://shop.example.com/invoice?id=1001
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where IDOR vulnerabilities hide
&lt;/h2&gt;

&lt;p&gt;IDs are not always in the address bar. During a penetration test we look for object references in every part of a request:&lt;/p&gt;

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

&lt;h2&gt;
  
  
  Types of IDOR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Read IDOR:&lt;/strong&gt; you can view data that belongs to someone else, such as invoices, chats, medical reports or ID documents.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Write IDOR:&lt;/strong&gt; you can change someone else's data, for example updating another user's email address or shipping address.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Delete IDOR:&lt;/strong&gt; you can delete other users' records, files or comments.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Function level issues:&lt;/strong&gt; 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).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why IDOR happens
&lt;/h2&gt;

&lt;p&gt;Most IDOR bugs come from one wrong assumption: &lt;em&gt;"the user is logged in, so the request must be fine."&lt;/em&gt; 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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  How security testers find IDOR
&lt;/h2&gt;

&lt;p&gt;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:&lt;/p&gt;

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

&lt;p&gt;Burp Suite extensions such as Autorize help by replaying requests with a second session automatically. Our &lt;a href="https://bugfynd.com/api-security-testing-checklist/" rel="noopener noreferrer"&gt;API security testing checklist&lt;/a&gt; covers BOLA and BFLA tests in more detail.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; 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.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to fix and prevent IDOR
&lt;/h2&gt;

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

&lt;h2&gt;
  
  
  Quick IDOR checklist for developers
&lt;/h2&gt;

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

&lt;h2&gt;
  
  
  Frequently asked questions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Is IDOR the same as BOLA?
&lt;/h3&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h3&gt;
  
  
  How serious is an IDOR vulnerability?
&lt;/h3&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can automated scanners detect IDOR?
&lt;/h3&gt;

&lt;p&gt;Rarely. Scanners do not know which data belongs to which user, so IDOR is mainly found through manual testing with multiple accounts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Get your application tested for IDOR
&lt;/h2&gt;

&lt;p&gt;At Bugfynd we test &lt;a href="https://bugfynd.com/services/" rel="noopener noreferrer"&gt;web applications, APIs and thick client apps&lt;/a&gt; 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 &lt;a href="https://bugfynd.com/sample-reports/" rel="noopener noreferrer"&gt;sample pentest reports&lt;/a&gt;, or learn to find bugs like this yourself in our &lt;a href="https://bugfynd.com/training/" rel="noopener noreferrer"&gt;web application pentesting course&lt;/a&gt; taught in English and Telugu.&lt;/p&gt;

&lt;p&gt;Questions or a project to discuss? Email &lt;a href="mailto:contact@bugfynd.com"&gt;contact@bugfynd.com&lt;/a&gt; or message us on WhatsApp.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;This article was originally published on the &lt;a href="https://bugfynd.com/what-is-idor-vulnerability/" rel="noopener noreferrer"&gt;Bugfynd blog&lt;/a&gt;. Bugfynd is a cyber security company in Hyderabad and Visakhapatnam, India, offering web application, API and thick client penetration testing and hands-on security training.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>webdev</category>
      <category>api</category>
      <category>cybersecurity</category>
    </item>
  </channel>
</rss>
