Protect Your Assets
Showing results for 
Search instead for 
Do you mean 

The Vuln Less Common series, Part 1: Mass Assignment Vulnerabilities

DennisAntunes ‎03-31-2014 07:39 AM - edited ‎10-07-2015 08:31 AM

Part 1: Mass Assignment Vulnerabilities




Before you can understand mass assignment vulnerabilities, you should have a basic understanding of the Model-View-Controller application design pattern.

Presented below is a somewhat generic and over-simplified view of its components and relevant features.



In MVC, the model provides an interface (API) to the controller for the retrieval and manipulation of core data.



The view is responsible for the presentation of data as provided by the controller or from direct interaction with the model.



In MVC, the controller is responsible for accepting, handling and validating user input as provided by the view. This input is then used to interact with and update the model accordingly.


Active Record

Ubiquitous application design pattern where database tables are wrapped in a class and database records are treated as objects. Take for an example, a database record of a user. This record likely has the following columns: name, address, email, password, role, etc. By modeling this user in memory, the application allows for manipulation of the record's state in an object-oriented manner. This approach takes the place of classic direct interaction with the database.


        Classic approach: UPDATE users SET name = 'joe' WHERE id = 2

        Active record-based approach: = 'joe'


Mass Assignment

Mass assignment is an MVC feature that allows all parameters of an HTTP request to be assigned as variables to an active record. Let's use our user-record again for an example:




Our model would then be updated for the user where = 2 as:

  = 'joe' = ''

        user.password = 'foobar'



The Vulnerability

Mass assignment vulnerabilities arise in instances where the application allows mass assignment, but does not limit or provide proper access control around the attributes which can be updated.


Here's a classic example whereby a user creates a new account and assigns himself administrative access through mass assignment:




This is a common example, as its is quite easy grasp the concepts from it, but the situations where these vulnerabilities can and will arise are endless. Here at Fortify on Demand, we've uncovered a number of mass assignment vulnerabilities in various applications allowing for mostly privilege-related and data corruption-based attacks. The risks involved are usually quite significant but can run the entire risk spectrum depending of course on the nature of the application and the value of the stored data.



Implementation will vary by framework, but restricted properties and methods should be explicitly declared to prevent their unwanted manipulation and modification.  Input validation using a whitelist approach can additionally be employed as part of a defense in depth strategy. Consult your framework's documentation for specific details.




Uncovering mass assignment vulnerabilities requires the web penetration tester to manually interact with the application using some type of interception proxy, closely observing parameter names and values and with careful attention paid to key state-changing functionality. Educated guesses are then made by the tester as to what additional attributes maybe added and manipulated.


FoD provides this high-level of manual testing as part of our advanced dynamic testing offerings. Click here to learn more about our dynamic application testing services and of course feel free to reach out to me with any questions via Twitter (@antunesdennis) or via email ( 



About the Author


27 Feb - 2 March 2017
Barcelona | Fira Gran Via
Mobile World Congress 2017
Hewlett Packard Enterprise at Mobile World Congress 2017, Barcelona | Fira Gran Via Location: Hall 3, Booth 3E11
Read more
Each Month in 2017
Software Expert Days - 2017
Join us online to talk directly with our Software experts during online Expert Days. Find information here about past, current, and upcoming Expert Da...
Read more
View all