Understanding IDOR: A Key Vulnerability in Web Security
Maruf Farhan
Lecturer at Ulster University London | CSC Tutor at Sussex ISC | Lecturer (Cybersecurity) at Coventry University | Educator at Kingsley Institute | MSc Cybersecurity | Comp Sec+ Certified | Blockchain Researcher
What is an IDOR?
IDOR stands for Insecure Direct Object Reference. It is a type of access control vulnerability that occurs when a web server receives user-supplied input to retrieve objects (files, data, documents), and this input is not validated on the server side to confirm the requested object belongs to the user making the request. This vulnerability can lead to unauthorised access to sensitive information.
A Simple Scenario
Imagine you've just signed up for an online service and you want to change your profile information. The link you click on is herehttps://online-service.thm/profile?user_id=1305, and you can see your information. Out of curiosity, you try changing the user_id value to 1000 (https://online-service.thm/profile?user_id=1000), and to your surprise, you can now see another user's information. You've discovered an IDOR vulnerability! Ideally, there should be a check on the website to confirm that the user information belongs to the user making the request.
Identifying IDOR Vulnerabilities
Locating IDORs
IDOR vulnerabilities may not always be visible in the URL. They can be hidden in AJAX requests or referenced in JavaScript files. During development, endpoints with parameters like /user/details?user_id=123 might be left in production, allowing unauthorised data access.
A Practical Example
Consider an online service where, after logging in, you can change your username, email address, and password. The username and email fields are pre-filled with your information. To investigate how this information gets pre-filled:
领英推荐
After signing up for the account, when you go to the dashboard and account details, you can see that your information is already there. The?Your Account?section gives you the ability to change your information, such as your username, email address, and password. You'll notice the username and email fields pre-filled in with your information.?
We'll start by investigating how this information gets pre-filled. If you open your browser developer tools, select the network tab, and then refresh the page, you'll see a call to an endpoint with the path /api/v1/customer?id={user_id}.
So if you double-click on it, it will open in a new page
So if you change the ID number, then you can see the details of user ID.
For example, user ID 1
Final Thoughts
Understanding and identifying IDOR vulnerabilities is crucial for web security. By knowing how these vulnerabilities occur and how to detect them, you can better protect sensitive information and ensure robust access control mechanisms are in place. Happy testing, and stay secure!
copyright: TryHackMe