Skip to content
Back to Blog
·9 min read·technology

Broken Access Control and IDOR: The #1 Web Vulnerability

Broken access control tops OWASP A01 as the most prevalent web vulnerability. Learn what IDOR and BOLA are and how to fix them in Indian applications.

BR

Bachao.AI Research Team

Cybersecurity Research

Scan Your Attack Surface

Security exposure this creates

Unpatched vulnerabilities in your tech stack are the #1 entry point for breaches targeting Indian businesses. Here's what to watch.

Broken Access Control is the most dangerous web vulnerability in 2023 according to OWASP — ranking #1 in the OWASP Top 10. It happens when an application fails to enforce who is allowed to access which data. The most common form is Insecure Direct Object Reference (IDOR): a user changes a number in a URL or API request and retrieves another user's records because the server never checks ownership. For Indian developers and security teams, this vulnerability is responsible for a disproportionate share of data breaches affecting customer records, financial data, and regulated personal information.

94%of web apps tested showed some form of broken access control (OWASP Top 10 2021)
#1OWASP Top 10 2021 rank — Broken Access Control displaced Injection after a decade at the top (OWASP 2021)

What Is Broken Access Control

Access control is the mechanism that enforces "user A can only read and modify user A's own data." When that enforcement is absent, incomplete, or bypassable, the application has broken access control.

OWASP lists it at A01:2021 — the top position — because it was found in 94 percent of tested applications during their research cycle. The category consolidates several related weaknesses that were previously separate in older OWASP editions, including IDOR, path traversal, privilege escalation, and missing function-level access control.

🚨
DANGER
Broken access control is almost never caught by static analysis or dependency scanners alone. It requires runtime context: who is authenticated, what they are requesting, and whether the application verified ownership before serving the response.

Authentication vs Authorisation: The Core Gap

Most Indian development teams implement authentication correctly — a login form, OTP, JWT token. The failure happens at the next step: authorisation. These two concepts are distinct:

ConceptQuestion it answersCommon implementation
Authentication (AuthN)Who are you?OTP, password, OAuth token
Authorisation (AuthZ)Are you allowed to do this?Ownership check, RBAC, ABAC
IDOR failureAuthN passed, AuthZ never ranServer uses ID from request, skips ownership check
A user who successfully logs in is authenticated. Whether they are authorised to view order #10042 belonging to a different user is a separate check — and this is exactly what is missing in IDOR-vulnerable code.

What IDOR Looks Like

IDOR (Insecure Direct Object Reference) occurs when a user-controlled value — an ID, filename, or reference — is used directly to fetch a backend object without verifying that the requesting user owns or has rights to that object.

Vulnerable example (Node.js / Express):

javascript
// VULNERABLE — no ownership check
app.get('/api/orders/:id', authenticateJWT, async (req, res) => {
  const order = await db.orders.findById(req.params.id);
  return res.json(order);
});

Here authenticateJWT confirms the user is logged in — authentication passes. But the query returns any order matching req.params.id, regardless of whether order.userId === req.user.id. A logged-in attacker can iterate id values and exfiltrate every order in the database.

Fixed example:

javascript
// SECURE — ownership enforced at query level
app.get('/api/orders/:id', authenticateJWT, async (req, res) => {
  const order = await db.orders.findOne({
    where: { id: req.params.id, userId: req.user.id }  // authz: ownership
  });
  if (!order) return res.status(404).json({ error: 'Not found' });
  return res.json(order);
});

The fix binds userId to the authenticated user's identity inside the query. The attacker's request now returns 404 regardless of which ID they supply.

⚠️
WARNING
Returning a 403 (Forbidden) on IDOR is acceptable but leaks the existence of the record. Returning 404 is preferred — it neither confirms the record exists nor identifies a permission boundary.

Know your vulnerabilities before attackers do

Run a free VAPT scan — takes 5 minutes, no signup required.

Book Your Free Scan

How an IDOR Attack Flows

The diagram below shows the complete attack path and where the authorisation gate must be inserted.

graph TD A[Attacker logs in
authenticated as User B]:::normal --> B[Sends GET /api/invoice/1001
User B owns invoice 2055]:::danger B --> C{Server receives request}:::normal C --> D[JWT verified — AuthN passes]:::success D --> E{Ownership check present?}:::normal E -->|No check| F[Query DB by id=1001
no user filter]:::danger F --> G[Returns User A invoice
IDOR exploited]:::danger E -->|Check present| H[Query DB where id=1001
AND userId=B]:::success H --> I{Record belongs to B?}:::success I -->|Yes| J[Return invoice to B]:::success I -->|No| K[Return 404 Not Found
attack blocked]:::success classDef normal fill:#1e3a5f,stroke:#3B82F6,color:#e2e8f0 classDef danger fill:#5f1e1e,stroke:#EF4444,color:#e2e8f0 classDef success fill:#1e3d2f,stroke:#10B981,color:#e2e8f0

BOLA: The API-era Name for IDOR

BOLA (Broken Object Level Authorisation) is the OWASP API Security Top 10 equivalent of IDOR, specifically framed for REST and GraphQL APIs. If your product exposes an API — a mobile app backend, a B2B integration endpoint, a SaaS webhook — BOLA is the primary risk to assess.

The mechanics are identical: an authenticated API caller supplies an object identifier they do not own and receives data they should not see. The difference is context: web IDOR often involves a browser URL or form field; BOLA involves API request bodies, path parameters, and query strings.

OWASP's API Security project lists BOLA at API1:2023 — the single highest-risk API vulnerability.

Horizontal vs Vertical Privilege Escalation

Broken access control manifests as two distinct escalation patterns:

Horizontal escalation — A user accesses resources belonging to another user at the same privilege level. Example: logged-in customer views another customer's invoice by changing the ID. This is the classic IDOR scenario.

Vertical escalation — A lower-privileged user accesses functions or data reserved for a higher privilege level. Example: a standard user calls /api/admin/users and gets a full user list because the route only checks authentication, not the admin role.

Both are covered under OWASP A01. Both require the same fix: enforce authorisation server-side for every object and every function, not just at the route entry point.

pie title Web Apps Tested by OWASP 2021 — A01 Broken Access Control Presence "Broken Access Control Found" : 94 "No Finding" : 6

Real-World IDOR Patterns Found in Indian Applications

These are categories of IDOR commonly found during automated VAPT assessments — not fabricated scenarios, but structural patterns that recur across industries:

1. Sequential integer IDs in financial APIs Invoice, order, and payment endpoints using auto-increment primary keys (/api/payment/1, /api/payment/2) without ownership binding. An attacker with one valid ID can enumerate the entire payments table.

2. UUID does not replace authorisation Switching from integer IDs to UUIDs reduces guessability but does not prevent IDOR. A UUID that leaks through a shared link, log entry, or another endpoint becomes exploitable.

3. GSTIN and PAN lookups without tenant scoping Tax and compliance portals that return entity data based on a GSTIN or PAN parameter without verifying the requesting user's relationship to that entity.

4. Document download endpoints /api/documents/download?file=contract_1234.pdf returns any document if the filename is guessed or enumerated, bypassing all upload-time access controls.

🛡️
SECURITY
Run a free VAPT scan on your application to detect IDOR and broken access control patterns automatically. Bachao.AI built by Dhisattva AI Pvt Ltd runs structured access-control probes across your endpoints and surfaces ownership-bypass vulnerabilities in the report.

Prevention: Enforce Authorisation Server-Side on Every Object

The NIST SP 800-53 access control family (AC controls) and OWASP's authorisation cheat sheet align on the same principles. Translate these into your codebase:

ControlWhat it meansImplementation
Deny by defaultIf no explicit grant exists, denyEvery new route starts with return 403 until ownership logic is added
Enforce at object levelCheck ownership on every fetch, not just route entryBind userId / tenantId in every DB query, not just in middleware
Indirect referencesNever expose internal IDs to clientsUse UUIDs or map public tokens to internal IDs server-side
Centralise authz logicOne authorisation module, not scattered if checksUse a policy engine or a dedicated canAccess(user, resource) function
Audit log accessLog every object access with the requester's identityFeed into your SIEM or incident tracker
Automated testingIDOR is testable — automate it in CIUse VAPT tooling or DAST scanners in your pipeline

Deny by Default in Practice

javascript
// Central ownership guard — reusable
async function requireOwnership(userId, resourceId, table) {
  const record = await db[table].findOne({
    where: { id: resourceId, userId }
  });
  if (!record) throw new ForbiddenError('Access denied');
  return record;
}

// Every handler calls the guard — no scattered checks
app.get('/api/invoices/:id', authenticateJWT, async (req, res) => {
  const invoice = await requireOwnership(req.user.id, req.params.id, 'invoices');
  return res.json(invoice);
});

This pattern makes IDOR structurally impossible on any endpoint that uses the guard — and makes auditing easy because authorisation lives in one place.

DPDP Act Compliance and Access Control

India's Digital Personal Data Protection Act 2023 (MeitY) imposes obligations on Data Fiduciaries to implement technical safeguards for personal data. An IDOR vulnerability that allows unauthenticated or cross-user access to personal data is a direct failure of this obligation.

The DPDP Act requires that personal data be processed only for consented purposes and be protected from unauthorised access. A customer exposing their own account data through an IDOR flaw can lead to a reportable breach under the Act — with penalties scaling with the severity of the failure.

If your organisation needs a structured compliance assessment, the DPDP compliance page covers the intersection of VAPT findings and DPDP obligations.

What CERT-In Recommends

CERT-In's vulnerability disclosure programme and its published guidelines for web application security consistently flag broken access control as a high-severity finding. Under CERT-In's incident reporting rules (Information Technology Amendment Rules 2022), organisations must report certain categories of data breaches within six hours. An IDOR-driven breach affecting customer financial or personal data qualifies.

Organisations seeking a CERT-In-aligned assessment should engage a CERT-In empanelled partner for formal reporting — the automated scan surfaces the technical vulnerabilities; empanelled-partner engagement for formal reporting is available as a separate service.

🎯Key Takeaway
Broken access control (OWASP A01) is the most prevalent web vulnerability class. IDOR and BOLA exploit the gap between authentication (who are you) and authorisation (what can you access). The fix is not a library or a framework setting — it is enforcing ownership checks server-side on every object fetch, every time, with deny-by-default as the starting point.

Frequently Asked Questions

What is the difference between authentication and authorisation in the context of IDOR?
Authentication confirms a user's identity — they logged in with a valid OTP or password. Authorisation checks whether that identity has permission to access a specific resource. IDOR exploits the gap where authentication succeeds but authorisation is never checked, so the server returns any object the user requests by ID.
Does using UUIDs instead of integer IDs prevent IDOR?
No. UUIDs reduce the chance of guessing an ID, but if the server returns any record matching the UUID without verifying the requester owns it, the vulnerability still exists. UUIDs are a mitigation for enumeration, not a fix for missing authorisation logic.
What is BOLA and how is it different from IDOR?
BOLA (Broken Object Level Authorisation) is the same vulnerability class framed for API contexts by the OWASP API Security Top 10. The mechanics are identical — a caller supplies an object ID they do not own and the server returns the object. BOLA is the preferred term in API security discussions; IDOR is more common in web application contexts.
How do I test my application for IDOR vulnerabilities?
The most reliable approach is authenticated DAST scanning — run requests as a logged-in user and check whether substituting another user's object IDs returns data. Automated VAPT tools structured for access control probing can do this systematically across all endpoints. Manual testing by iterating IDs in an intercepting proxy is also effective for targeted checks.
Is IDOR a DPDP Act compliance issue for Indian businesses?
Yes. If an IDOR vulnerability allows cross-user access to personal data, it is a failure of the technical safeguards required under India's Digital Personal Data Protection Act 2023. A resulting data exposure would likely qualify as a reportable breach. Organisations should include IDOR testing as part of their DPDP compliance posture.
What is the fastest way to prevent IDOR in an existing codebase?
Centralise your authorisation logic in a single reusable function that always binds the requesting user's identity to every database query. Audit every endpoint that fetches a resource by a user-supplied ID and verify that the query includes an ownership condition. Enforce deny-by-default: new routes should require an explicit authorisation grant before any object is returned.
BR

Bachao.AI Research Team

Cybersecurity Research

AI-powered security research and threat intelligence from the Bachao.AI team. Covering the latest vulnerabilities, CVEs, and cybersecurity developments affecting Indian businesses.

Get cybersecurity insights for Indian SMBs

Weekly vulnerability alerts, DPDP compliance tips, and security guides. No spam — unsubscribe anytime.

We respect your privacy. Your email is never shared.

Find out if you're exposed to this class of threat

Free automated scan — risk score in under 2 hours. No credit card required.

Scan Your Attack Surface
Find your vulnerabilitiesStart free scan →