๐Ÿš€ Join our AI Wargame at Black Hat Asia and our Workshop + Wargame at NDC Sydney .


Insecure Direct Object Reference

Insecure Direct Object Reference (IDOR) occurs when an application exposes internal implementation objects (e.g., database keys, filenames, or record IDs) and allows users to directly manipulate or access them without proper authorisation checks. An adversary can exploit this by guessing or modifying identifiers in requests (such as changing user_id=123 to user_id=124) to gain unauthorised access to sensitive data or perform actions on behalf of other users.

Remediation

  • Avoid exposing sensitive internal resources via identifiers; where possible, resolve objects server-side based on the authenticated userโ€™s session or context.
  • Do not rely on predictable or sequential identifiers (e.g., auto-incrementing IDs, guessable strings).
  • Enforce strict server-side authorisation checks on every request to ensure users can only access resources they are explicitly permitted to.
  • Use indirect object references (e.g., opaque, randomised tokens or UUIDs) in place of raw identifiers exposed to clients.
  • Apply logging and monitoring to detect suspicious access patterns that may indicate IDOR exploitation.

Metadata

  • Severity: medium
  • Slug: insecure-direct-object-reference

CWEs

  • 639: Authorization Bypass Through User-Controlled Key
  • 425: Direct Request ('Forced Browsing')
  • 340: Generation of Predictable Numbers or Identifiers

OWASP

  • A07:2021: Identification and Authentication Failures
  • A01:2021: Broken Access Control

Available Labs

Open Javascript labs in SecDim Play for this vulnerability.

Deco line
Deco line

Play AppSec WarGames

Want to skill-up in secure coding and AppSec? Try SecDim Wargames to learn how to find, hack and fix security vulnerabilities inspired by real-world incidents.

Deco line
Deco line

Got a comment?

Join our secure coding and AppSec community. A discussion board to share and discuss all aspects of secure programming, AppSec, DevSecOps, fuzzing, cloudsec, AIsec code review, and more.

Read more