Home Mass Assignment -> Horizontal Privilege Escalation
Post
Cancel

Mass Assignment -> Horizontal Privilege Escalation

Mass Assignment -> Horizontal Privilege Escalation

Software frameworks sometime allow developers to automatically bind HTTP request parameters into program code variables or objects to make using that framework easier on developers. This can sometimes cause harm. Attackers can sometimes use this methodology to create new parameters that the developer never intended which in turn creates or overwrites new variable or objects in program code that was not intended.

Exploitation

mass

This webaapp is vulnerable to mass assignment , which will allow attacker to access information that he doesn’t have permission.

Since we have been given a credentials, we will login to see how the application is working.

mass

mass

As you can see , we have access to company 1 information, but our goal here is to access company 2 information.

To do that, we will login again and intercept the request in burpsuite.

mass

The application was submitting user[username]=user1&user[password]=pentesterlab. So If it’s vulnerable to mass assignment, and has company attribute, we can overwrite the company attribute by adding either user[company_id]=2 or user[company]=2 to our request.

Let’s try this trick with this payload user[username]=user2&user[password]=user2&user[company]=2

mass

mass

We got internal Server Error, which might be because of invalid attribute.

We will try again with company_id. Our payload will be user[username]=user2&user[password]=user2&user[company_id]=2

mass

mass

Done!.

Mitigations

  • Use Data Transfer Objects (DTOs).

References

This post is licensed under CC BY 4.0 by the author.