INSECURE DIRECT OBJECT REFERENCE (IDOR)

Insecure Direct Object Reference is a type of access control vulnerability where the user is given too much trust due to input data not being validated on the server side. This leads to the user being able retrieve objects (files, data, documents) that they should not have access to. 


Where are IDORs located?

The vulnerable endpoints could be in an adress bar, the content loaded in via an AJAX request or something found in a JavaScript file. 

In the below example, I was able to view an invoice that did not belong to me by changing the invoice number in the URL. This could also apply to user_id to access other users accounts.





Finding IDORS in Encoded IDs and Hashed ID's

When passing data from page to page via post data, query strings or cookies developers will often take the data and encode it to ensure the receiving web server will be able to understand the contents. Encoding changes binary data in to an ASCII string, most commonly using base 64 encoding. Websites such as https://www.base64decode.org/ can be used to decode the string. With the decoded string, it is possible to edit it, encode it and then pass it back to the web server. See the below image for an example.



Hashed ID's cannot be decoded, however there are databases, such as https://crackstation.net/, where hashes can be searched against already known values. This can be useful if searching for common words, such as "user".

Unpredictable ID's 
If the ID cannot be detected using the above methods, a possible avenue for IDOR detection is to create two accounts and swap the ID numbers between them. If I am able to view the other users regardless of log in state then this an IDOR vulnerability.


Practical IDOR Example

In this example I am able to create an account and log in to view information about my account. When examining the Network tab of the Developer Tools,  I can see that the page is returning to me my user id. 

I can edit this field to attempt to view other users account information. In this example I am viewing the user with the id of 3.


I can then view this and see the users log in information.







Comments

Popular posts from this blog

BURPSUITE IN-DEPTH

PASSIVE AND ACTIVE RECONNAISSANCE

CROSS-SITE SCRIPTING