Written by: Mio Kanzaki(Security Analyst (AI))Reviewed by: 千葉圭介Updated
Mass assignment is a flaw that lets submitted data rewrite fields that were never meant to be changed. OWASP's guide describes it as a problem in which a framework's feature of automatically binding the contents of a request to an object ends up setting fields the developer did not intend to expose. This automatic binding is also called autobinding.
How does mass assignment work?
Consider a membership sign-up form. Only the "Name" and "Email" boxes are printed on it. But if the clerk's rule is to copy every added character into the ledger as it is, the applicant can add a "Member rank" box and promote themselves.
A program works the same way. Even if it was built to accept only a name and an email, a design that takes in every submitted field may let the sender rewrite even the field that shows whether the user is an administrator. In this example, OWASP's guide introduces the method of using an input-only object (a DTO) that does not contain the field that marks an administrator.
Another method is an allow list that states which fields are accepted. OWASP also points out that a method that only lists the fields to reject misses newly added fields. The free URL check reads a public page of your site. It does not test API requests, which belong to an assessment agreed with you in advance.
Why does mass assignment matter?
Screens for member information, orders and settings are all built on processing that receives input and saves it. If there is a gap in how it is saved, there is room to rewrite fields that have no input box.
In the 2023 edition's API3, the OWASP API Security Top 10 merged two items from the 2019 edition into one. The two were Excessive Data Exposure and Mass Assignment. The item is named "Broken Object Property Level Authorization". It treats the problem as controlling, field by field, which fields are shown and which can be rewritten.
MITRE's CWE-915 countermeasures also include a point to prefer allow lists over deny lists. If you run the site, ask your development contact whether the update processing for members and orders limits the fields it accepts.
Related terms
- Excessive data exposure: a flaw in which an API returns more information than needed.
- Business logic vulnerability: a flaw in which a gap in the specification is used to gain unfairly.
Next step
Points to check in detail are on the mass assignment vulnerability page. To review your update processing, contact us; testing how an API responds is part of an API security assessment carried out with your prior consent. The free URL check covers only what a public page shows.
Frequently asked questions
Can mass assignment occur in any language or framework?
It can occur wherever a mechanism automatically binds the contents of a request to an object. CWE-915 gives examples of the form it takes in frameworks such as Ruby on Rails, Spring MVC and ASP.NET MVC.
Is an allow list enough to be safe on its own?
OWASP's guide explains that an allow list or an input-only object is no substitute for an authorization check on the data and the operation concerned. Also perform authorization checks.
Frequently asked questions
Can mass assignment occur in any language or framework?
It can occur wherever a mechanism automatically binds the contents of a request to an object. CWE-915 gives examples of the form it takes in frameworks such as Ruby on Rails, Spring MVC and ASP.NET MVC.
Is an allow list enough to be safe on its own?
OWASP's guide explains that an allow list or an input-only object is no substitute for an authorization check on the data and the operation concerned. Also perform authorization checks.