Security Products
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 Vulnerabilitybullet-hole-in-glass-md.png

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


Leave a Comment

We encourage you to share your comments on this post. Comments are moderated and will be reviewed
and posted as promptly as possible during regular business hours

To ensure your comment is published, be sure to follow the Community Guidelines.

Be sure to enter a unique name. You can't reuse a name that's already in use.
Be sure to enter a unique email address. You can't reuse an email address that's already in use.
Type the characters you see in the picture above.Type the words you hear.
1-3 December 2015
Discover 2015 London
Discover 2015 in London, the ultimate showcase technology event for business and IT professionals to learn, connect, and grow.
Read more
November 2015
Software Online Expert Days
Join us online to talk directly with our Software experts.
Read more
View all