Sovra Recon·Glossary · Mass assignment

Mass Assignment: Definition, Example, and Protection

By Solan Barlet, co-founder of Sovra Recon
Updated October 29, 2026

In short

A mass assignment vulnerability occurs when an application automatically copies all fields from a request into an object or a database record without filtering out those that the user is authorized to modify. By adding a field such as “role” or “isAdmin” to their request, an attacker can alter properties that should remain under the server’s control, ultimately gaining administrator privileges. Depending on the framework, it is also known as autobinding (Spring, ASP.NET) or object injection (PHP).

An example

A profile form submits the user’s name and email address. On the server side, the framework binds the entire request to the User model, which also contains a “role” field. The attacker intercepts the request, adds “role=admin,” and the record is updated with this new role. The form did not display this field, but the server accepted it.

The most well-known case dates back to 2012: a vulnerability of this type on GitHub, a Ruby on Rails application, allowed a user to add their public key to any organization and thus modify its repositories. The OWASP API Security Top 10 2023 classifies this issue under “Broken Object Property Level Authorization” (API3:2023).

How to Protect Against It

  • Whitelisting: explicitly declare the fields that the user can modify (strong parameters in Rails, the `fillable` property in Laravel).
  • Dedicated Transfer Objects (DTOs): Never bind a query directly to the database model.
  • Protect sensitive fields (role, balance, owner, verification status) from being modified by the user.
  • Verify on the server side, for each modified field, that the user has permission to modify it.

Frequently asked questions

Do modern frameworks protect against mass assignment?

Most frameworks offer a whitelisting mechanism, which is sometimes enabled by default. The vulnerability arises when a developer bypasses this mechanism to save time, or in APIs that directly map requests to database objects.

Sources

Find out where an attacker would get in.

Our AI agents actually attack your scope, fully automated, and hand you the proof of every vulnerability.