Sumeru Cyber Security
  • Sumeru Cyber Security
  • Workarounds for prevalent vulnerabilities
    • Version Disclosure
    • Host Header Attack
    • HttpOnly and Secure Flag
    • Security Headers
    • Clickjacking
    • Weak Password
    • Username Enumeration
    • jQuery Outdated
    • Cross-Origin Resource Sharing
    • AWS S3 Bucket Misconfiguration
    • Directory Listing
    • Laravel Debug Enabled
    • Autocomplete and Remember Password Enabled
    • Brute Force Attack
    • Cross Site Request Forgery
    • SQL Injection
    • PhpMyAdmin page Available Publicly
    • Implementation of BASIC Authentication
    • Cache Browsing
    • Insecure Direct Object Reference
    • Active mixed content over https
    • Improper forgot password implementation
    • ASP.NET Debug Enabled
    • Sensitive Data Sent in GET Request
    • Weak CAPTCHA Implementation
    • Csv Injection
    • Cross Site Scripting
    • Web Server Robot.txt Information Disclosure
    • SSL Related Issues
    • Local File Inclusion
    • Weak CAPTCHA Implementation
    • Automated Form Submission
    • Php.ini File Available Publicly
    • ITLP
    • Internal Path Disclosure
    • Insecure Direct Object Reference
    • Access Token Not Expiring After Logout
  • OWASP A09-Security Logging and Monitoring Failures
  • OWASP API09-Improper Inventory Management v1.0
Powered by GitBook
On this page
  • Introduction
  • How to Test
  • How to Fix
  • PHP
  • JAVA
  • References

Was this helpful?

  1. Workarounds for prevalent vulnerabilities

Insecure Direct Object Reference

IDOR

PreviousCache BrowsingNextActive mixed content over https

Last updated 5 years ago

Was this helpful?

Introduction

Insecure Direct Object References(IDOR) occur when an application provides direct access to objects based on user-supplied input. As a result of this vulnerability, attackers can bypass authorization and access resources in the system directly, for example, database records or files.In simple words, it’s like getting sensitive information by just changing a few values in the parameter.

How to Test

Hacker identifies web application using direct object reference(s) and requests verified information. Valid http request is executed and direct object reference entity is revealed.

Direct object reference entity is manipulated and http request is performed again. Http request is performed without user verification and hacker is granted access to sensitive information.

How to Fix

  • Enforce access control policies such that users cannot act outside of their intended permissions.

  • Use hash function and use hashed values instead of normal numbers or strings.

Instead of this,

http://www.example.com/user.php?id=12

We can make it like this,

http://www.example.com/user.php?id=ea3eda3d3w2293

PHP

$RandomAccountNumber = uniqid();
move_uploaded_file($ProfilePicTemp, "Content/" . $RandomAccountNumber);

JAVA

Randomrandom=new Random();
Stringext = ".jpeg";
Filedir = new File("/home/pregzt");
Stringname = String.format("%s%s",System.currentTimeMillis(),random.nextInt(100000)+ext);
Filefile = new File(dir, name);

References

)

https://spanning.com/blog/insecure-direct-object-reference-web-based-application-security-part-6/
https://codeburst.io/hunting-insecure-direct-object-reference-vulnerabilities-for-fun-and-profit-part-1-f338c6a52782
https://www.acunetix.com/blog/web-security-zone/what-are-insecure-direct-object-references/