OOmnistu

Blog / Engineering Playbooks

Engineering Playbooks

Mass assignment: when a request sets fields it should not

Prevent requests from setting unintended fields by defining which properties each operation may accept and change.

OOmnistu
Reviewed 2026-11-16 · 2 min read

Many web frameworks can bind request parameters straight into program objects, which saves code. OWASP's Mass Assignment Cheat Sheet describes the downside: an attacker can add parameters the developer never intended, creating or overwriting values the code was not meant to expose. We read the whole sheet on 15 November 2026. We did not read the framework documents, CWE-915 or the GitHub blog post it links.

Other names

OWASP lists: mass assignment (Ruby on Rails, NodeJS), autobinding (Spring MVC, ASP.NET MVC) and object injection (PHP).

The example in plain words

An account form sends a user ID, password and email. The server object behind it also has an administrator flag. If the handler binds the whole request to that object, an attacker adds isAdmin=true to the request and the flag is set, though the form never showed it.

When it is exploitable

The sheet says it is exploitable when attacker-controlled input can set or update fields the caller is not authorised to change, such as a role or an account owner. Field names can be guessed or discovered, so source code is not needed. Constructor and setter binding are both possible (it uses Spring as the example), and nested objects need review too. OWASP cites a 2012 GitHub incident where a user could add a public key to any organisation through mass assignment.

What to do

The sheet gives examples for Spring MVC, Mongoose, Laravel and others, and points to documentation for Rails, Django, ASP.NET, Grails, Play and several JSON mappers. We do not reproduce or test them. Look up your framework's current documentation.

Questions for your team

Related: authorization and access control basics, input validation basics, REST API security checklist.

Limits

One OWASP page, read in full. It reflects the sheet on the fetch date; framework behaviour changes, so check your framework's documentation. No statistics. The GitHub incident is OWASP's summary and we did not read the original post.

By Omnistu.

Sources

Previous
Adding maps to your app without a surprise bill: API key practices