Module 6 · IDOR & Authorization Bypass

Manish Garg
Manish Garg Associate of (ISC)² · RingSafe
Apr 19, 2026
13 min read
Read as

Last updated: May 1, 2026

Horizontal and vertical IDOR, mass assignment, multi-tenant boundary violations, GraphQL authorization. The highest-yield SaaS bug class. Pro module.
🎯 WEB APP PENTEST PATH
MEDIUM
🔐 PRO
⏱ 90 min
Module 6 of 8

What you’ll learn

  • Why authorization is the single highest-yield bug class in modern SaaS
  • Horizontal IDOR (accessing peer data) vs vertical IDOR (privilege escalation)
  • Mass assignment — updating fields you shouldn’t be able to
  • BOLA (Broken Object-Level Auth) vs BFLA (Broken Function-Level Auth)
  • Multi-tenant boundary violations — the SaaS-killer bug
  • GraphQL authorization — why it’s almost always wrong

Prerequisites: Modules 1–5.

In 2026, authorization is the single most commercially-impactful bug class in SaaS applications. It tops OWASP’s lists. Every pentest we run finds at least one. Authorization bugs produce the cleanest, scariest demos in pentest reports — “Look, this user can read all customers’ data. Yes, all of them. Yes, with a single HTTP request.” Developers can’t argue with the evidence, and regulators take these bugs seriously under DPDP’s “reasonable safeguards” standard.

This module teaches the four authorization bug classes that produce 90% of real-world findings.

The mental model

Authentication: who are you? Authorization: what are you allowed to do? A well-designed application asks both questions on every action. A poorly-designed application checks authentication once (at login) and trusts the client for authorization thereafter.

Authorization decisions live in two dimensions:

  • Function-level: is this user allowed to invoke this endpoint at all? (e.g., /admin/users)
  • Object-level: given they can invoke it, are they allowed to access this specific object? (e.g., order ID 42 belongs to a different user)

Both need to be enforced on every request, server-side. When either is missing or bypassed, you get one of the four authorization bugs below.

1. Horizontal IDOR (BOLA — Broken Object-Level Authorization)

Authenticated user A can access objects owned by authenticated user B by changing an identifier in the request.

GET /api/orders/12345
Authorization: Bearer <user A's token>
→ Returns order 12345, owned by user A.

GET /api/orders/12346
Authorization: Bearer <user A's token>
→ Returns order 12346, owned by user B. IDOR.

Root cause: endpoint checked authentication (“is this a valid token?”) but not ownership (“does this token’s user own order 12346?”).

Testing methodology

  1. Register two accounts, A and B.
  2. Take any action as B that creates an object (order, document, message, support ticket).
  3. Note the object’s identifier in the response URL or body.
  4. Log in as A. Try every HTTP verb (GET/PUT/PATCH/DELETE) against the endpoint with B’s ID substituted.
  5. Compare responses: 403/404 = secure. 200 = IDOR.

Don’t just test GET. Some endpoints check ownership on GET but forget on PATCH. That’s an “I can edit other users’ orders” bug, which is worse than just reading them.

Non-numeric IDs don’t save you

UUIDs and random strings prevent brute-force enumeration but don’t prevent IDOR. The attacker obtains the target’s UUID through any channel (a shared link, error messages, public APIs, a colleague’s screen), then exploits. Security-through-obscurity.

2. Vertical IDOR / Privilege Escalation (BFLA — Broken Function-Level Auth)

A low-privileged user accesses functionality intended for higher-privileged users.

GET /api/admin/users
Authorization: Bearer <regular user's token>
→ Returns all users. Should be 403.

Root cause: endpoint checks authentication but not role. Or role check is frontend-only (the admin menu is hidden from regular users, but the backend URL still responds).

Finding admin endpoints

  1. Log in as admin; capture every request. Note all URLs hit.
  2. Log in as regular user; replay the admin requests one by one. Which succeed?

If you don’t have admin access, enumerate routes from JavaScript bundles (Module 2’s technique). Routes like /admin/*, /internal/*, /api/v1/users/delete leak in bundles even when the frontend hides them.

3. Mass assignment

An API endpoint accepts more fields in the request body than the frontend exposes. Attacker supplies extra fields to modify state they shouldn’t control.

// Legitimate request from frontend:
PATCH /api/users/self
{
  "display_name": "Alice",
  "timezone": "Asia/Kolkata"
}

// Attacker adds extra fields:
PATCH /api/users/self
{
  "display_name": "Alice",
  "timezone": "Asia/Kolkata",
  "role": "admin",
  "is_verified": true,
  "credits_balance": 100000
}

Root cause: backend accepts the whole JSON body and applies all fields to the database model. Should have an explicit allowlist: only these fields can be updated by this user.

Testing methodology

  1. Observe a legitimate update request. Note the fields sent.
  2. Fetch the object via GET. Note all fields returned (there are usually more than the frontend sends).
  3. Try adding those extra fields to the update request. Re-fetch. Did they change?
  4. Extra credit: try fields not visible in GET but guessable — admin, role, verified, password, organization_id, subscription_tier.

Ruby on Rails has a long history of this (ActiveRecord’s update_attributes). Node.js with Mongoose — same pattern. Most modern frameworks default to allowlisting now, but developers override the defaults.

4. Multi-tenant boundary violations (the SaaS killer)

In a multi-tenant SaaS, every query must scope to the caller’s tenant. Miss one query — one endpoint, one cache lookup, one async job — and you have cross-tenant data access.

// Vulnerable:
SELECT * FROM documents WHERE id = ?

// Correct:
SELECT * FROM documents WHERE id = ? AND tenant_id = ?

The vulnerable query happily returns documents belonging to other tenants if the caller knows (or guesses) the document ID.

Where tenant boundaries break

  • Async jobs: background worker processes a task but forgets tenant context
  • Cache layers: cache key is the object ID without tenant prefix; a user in tenant A gets cached content for tenant B
  • Bulk operations: “fetch all for this user” correctly scopes; “fetch all” admin operation forgets
  • Webhooks: incoming webhook authenticated globally but not mapped to the correct tenant
  • Nested objects: parent is tenant-scoped; child object endpoint directly accessible by child ID without re-checking parent

Testing

Create two tenants. Perform identical actions in each. Swap any identifier from tenant A into a request made by tenant B’s user. Track what comes back.

GraphQL authorization

GraphQL’s per-field resolver model is an authorization nightmare. Every resolver must authorize independently; a vulnerable resolver reachable through a query path is still exploitable.

query {
  # Top-level — developer remembered to auth-check
  user(id: "me") {
    # Nested — developer forgot to auth-check organization resolver
    organization {
      # Even deeper nested — resolver returns ALL members
      members {
        email
        role
      }
    }
  }
}

Common GraphQL authorization failures:

  • Auth check on top-level query, not on nested resolvers
  • Aliased queries (query { a: user(id:1) { ... } b: user(id:2) { ... } }) bypass rate limits
  • Introspection enabled in production, leaking the full schema
  • Mutation endpoints where the frontend hides dangerous mutations but they’re accessible
  • Union/interface types where type-specific auth is missing

Tools: InQL Burp extension for GraphQL fuzzing. graphql-cop for schema auditing.

Exercises

1. IDOR hunt. PortSwigger Academy has 9 authorization labs. Complete at least the first 4 (horizontal IDOR through nested admin functions).

2. Mass assignment audit. Fetch your own user profile from any API you have credentials for (even your own test app). Enumerate all fields in the response. Pick three you shouldn’t be able to modify. Try a PATCH with them set.

3. GraphQL introspection. Find a public GraphQL endpoint (GitHub, Shopify Storefront API). Run an introspection query. How much of the schema is visible? What mutations exist?

Check your understanding

  • Why do UUIDs not prevent IDOR?
  • What’s the difference between BOLA and BFLA?
  • Why should you test every HTTP verb, not just GET?
  • What does an allowlist in mass-assignment mitigation actually do?
  • Why is GraphQL authorization more error-prone than REST?

Key takeaways

  • Authorization bugs are the #1 commercially-impactful finding in SaaS.
  • IDOR means ownership check missing; vertical IDOR means role check missing.
  • Mass assignment happens when backends accept whole objects without field allowlists.
  • Multi-tenant SaaS must scope every query to tenant_id — one miss is catastrophic.
  • GraphQL authorization must apply per-resolver, not just at the top-level query.

Take the 20-question quiz below to confirm your understanding. Pass with 70%+ to mark this module complete. Unlimited retries.

🧠
Check your understanding

Module Quiz · 20 questions

Pass with 80%+ to mark this module complete. Unlimited retries. Each question shows an explanation.

Up next
Module 7 · Business Logic Flaws

Continue →


⚙ Optimisation · Performance · Security — extended

Practical depth on what to tune, what to harden, and how this maps to Indian regulatory expectations.

IDOR at scale — why automated detection misses most of it

IDOR (Insecure Direct Object Reference) is functionally a missing authorisation check on a parameter. Automated scanners struggle because they cannot tell which IDs the test account “should” access — true IDOR requires understanding the app’s data model. Manual audit pattern:

1Log in as user A; perform every sensitive action; capture each request.
2Log in as user B; replay user A’s requests with B’s session cookie.
3Any 200 OK with A’s data is an IDOR.
4Repeat with B’s requests against A.
5Repeat with admin routes from a non-admin session. Scaling this: Burp Suite’s Autorize extension automates the replay; AuthMatrix tracks role matrices; Bradamsa fuzzes IDs. Hidden IDOR surface: GraphQL nodes, batch APIs, file paths, S3 pre-signed URLs, JWT-embedded user IDs that the server trusts.

Authorisation patterns — what good looks like

1Server-side ownership check on every request: SELECT ... WHERE id=$1 AND owner_id=$user_id rather than just WHERE id=$1.
2Indirect references — surface UUIDs or per-session-mapped tokens, never raw DB IDs. UUIDs are not security alone (still need ownership check) but defeat enumeration.
3Centralised authorisation layer — Casbin, OPA, AWS Cedar, Oso for non-trivial RBAC/ABAC.
4Object-level RBAC stored in the DB: every resource row has explicit grants.
5Defence in depth: API gateway enforces tenant-isolation; backend re-checks.
6Negative tests in CI: every release runs an authorisation matrix test that confirms cross-user isolation.

Operational hardening + IDOR detection

1Code review focus: every endpoint that takes an ID parameter must justify its authz; absence is a bug.
2Static analysis: Semgrep rules detecting “DB query without owner_id filter”.
3Logging: every authz failure logged at WARN; spike of WARNs from one user = enumeration.
4Anomaly detection: a single user accessing 1000+ unique resource IDs in 5 minutes = scraping or pivot prep.
5Rate-limiting per object class (GET /orders/$id ≤ 100/min/user).
6For SaaS multi-tenancy: tenant-id is the most-attacked IDOR vector; require explicit tenant filter in every query, enforce via lint.
7Indian context: under DPDP, an IDOR that exposes one user’s PII to another is a notifiable breach — even before regulatory action arrives, the company faces user-trust damage.

Real-world IDOR taxonomy — patterns we see in Indian VAPT

Sequential numeric IDs in URLs of healthcare apps — patient records reachable by incrementing the number. UUID with weak entropy — predictable timestamp-based UUIDs (UUIDv1) instead of UUIDv4. Mass-assign IDOR — POST /api/orders accepts customer_id in body; attacker overrides. JWT-embedded user-id without server validation — server trusts the JWT claim instead of session-derived identity. S3 pre-signed URL replay — URLs leaked in old emails / referrer headers retain validity. Webhook replay — incoming webhooks from third parties not validated against signature; attacker forges. Government portal IDOR — public sector portals (especially state-level) frequently expose Aadhaar / PAN / receipt numbers via IDOR. CERT-In and state CERTs receive multiple disclosures monthly.

Performance discipline that strengthens security

A practical performance discipline that applies regardless of the specific vulnerability class is to instrument every endpoint with three SLOs: latency at the 50th, 95th, and 99th percentiles. The 50th percentile reflects typical user experience, the 95th catches tail behaviour visible to a meaningful fraction of users, and the 99th captures the long-tail outliers that often hide bugs (timeouts on a stale dependency, locking contention under load, garbage-collection pauses on a hot endpoint). Every release should compare these percentiles against the previous baseline; regressions of more than ten percent on the 95th percentile are typically worth investigating before shipping. Modern observability stacks make this routine — Datadog APM, New Relic, Honeycomb, Grafana Tempo with OpenTelemetry instrumentation, and on the open-source side Jaeger plus Prometheus plus Grafana — but the discipline matters more than the tool. Indian product teams that have adopted this percentile-driven culture report fewer surprise outages and a smaller incident-response load over time, which compounds into a stronger security posture: the same instrumentation that catches a slow endpoint also catches an exploitation attempt that forces unusual code paths.

Observability that catches attacks alongside outages

Observability for security overlaps with observability for reliability but adds a few specific signals worth instrumenting. First, application-layer authentication and authorisation events should produce structured logs with the user identifier, the action attempted, the source IP, the User-Agent fingerprint, and the outcome. Second, every state-changing API call should log its idempotency key, the request body shape, and the resulting object identifier. Third, every external dependency call should log the destination, the response code, and the latency. Together these three categories produce a clean event stream that a SIEM can correlate to detect both functional regressions and active attacks. The cost is moderate — log storage in Elasticsearch or Splunk runs perhaps thirty to sixty rupees per gigabyte per year at typical Indian-tier prices — and the payoff is dramatic: incidents that previously took days to investigate are typically resolved in hours when the relevant evidence has been pre-indexed. Indian regulators increasingly expect this level of operational logging, particularly RBI under the Cyber Security Framework Annex 1 and SEBI under the CSCRF master circular.

DPDP and sectoral obligations a practitioner cannot ignore

Under India’s Digital Personal Data Protection Act 2023, the operational obligations on any web application that handles personal data extend beyond simple consent collection. Section 8 requires that data fiduciaries implement reasonable security safeguards — interpreted in practice as reflecting a documented information security programme, regular vulnerability assessment, and demonstrable controls aligned to a recognised standard such as ISO 27001 or NIST CSF. Section 9 imposes data principal rights including access, correction, and erasure, which means the application must be architected so that these requests can be fulfilled within the prescribed timeframes (currently expected to be on the order of thirty days). Section 8(6) imposes breach notification: when a personal-data breach occurs, the data fiduciary must notify the Data Protection Board and affected data principals within prescribed timeframes (the draft Rules suggest seventy-two hours for material breaches). For the practitioner this translates into specific engineering tasks: data inventory and lineage tracking, retention controls and automated deletion at end-of-purpose, audit-grade logging of every access to personal data, breach-detection telemetry, and a formal incident-response playbook with regulatory-notification templates. The 2024-2025 inspections by RBI and SEBI of regulated entities have already cited DPDP-overlay obligations, so the alignment is not theoretical; it shapes what auditors expect to see in the next inspection cycle.

A small threat-modelling routine before every release

A short threat-modelling exercise specific to this vulnerability class is worth running before each release. The classic STRIDE framework — Spoofing, Tampering, Repudiation, Information disclosure, Denial of service, Elevation of privilege — provides a useful checklist when applied to the specific data flow at hand. Begin by drawing the data flow for the feature being changed: external actors at the edge, the trust boundaries they cross, the back-end services involved, the data stores read or written, and the third-party integrations called. For each trust boundary crossing, ask which STRIDE categories apply and what controls mitigate them. The output is a small set of testable assertions: this endpoint must not allow tenant A to read tenant B’s records, this mutation must require step-up authentication, this third-party call must validate the response signature, and so on. Convert each assertion into an automated test or a manual verification step in the release checklist. The discipline pays off in two ways: first, it catches design-level bugs before they reach code review; second, it produces an auditable record of security thinking that regulators value. Indian product teams that have institutionalised this practice report fewer security incidents and shorter mean-time-to-remediate when issues are found, which compounds into better customer trust and lower regulatory friction over time.

Further reading

Additional FAQs

Are UUIDs enough to prevent IDOR?

No. UUIDs prevent enumeration but a leaked UUID still grants access if the server does not check ownership. UUIDs make exploitation harder; ownership checks make it impossible.

How do I test IDOR in microservices?

Each service must enforce ownership independently — assume any service can be reached by any caller. The service mesh / API gateway can pass user-id headers but the receiving service must validate, not trust them.

What is "BOLA" and how does it relate to IDOR?

BOLA (Broken Object Level Authorization) is the API-specific name for IDOR; OWASP API Top 10 #1. Same bug class, different acronym. The fix is the same: ownership check on every object access.

Want this for your team?

Custom team training + practitioner advisory

Beyond the free academy — we run private workshops, vCISO advisory, and red-team exercises tailored to your stack. For Indian SMBs scaling past their first hire.

Book team training call Replies in 4 working hrs · India-only · Senior consultants