Mass Assignment
The application binds request properties straight onto its data objects, so a user can set fields they should not control, such as their role or account status.
| Severity | High |
| CVSS 3.1 | 7.1 CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N Open in the calculator |
| CVSS 4.0 | 7.1 CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:H/VA:N/SC:N/SI:N/SA:N Open in the calculator |
| CWE | CWE-915: Improperly Controlled Modification of Dynamically-Determined Object Attributes |
| OWASP Top 10 | A08:2025 Software or Data Integrity Failures |
| MITRE ATT&CK | T1190 Exploit Public-Facing Application |
| Category | Broken Access Control |
Description
Many frameworks can copy the properties of a request directly onto a model or data object, which saves code when handling forms and API calls. If the application binds the whole request in this way without limiting which properties may be set, a user can add properties that the form or client never shows, such as role, isAdmin, verified, credit, ownerId or tenantId, and the application saves them.
An attacker with an ordinary account can therefore change properties that the application relies on for security or business rules. Typical results are granting themselves an administrative role, marking an account as verified or paid, adding credit, extending a subscription, or moving a record into another user's or tenant's ownership. The severity depends on which properties the bound object holds: it is greatest where roles, permissions, ownership or financial values sit on the same object as user-editable fields.
The weakness is known as mass assignment in Ruby on Rails, Laravel and Node.js, and as autobinding or over-posting in Spring MVC and ASP.NET. It is identified by comparing the properties an object exposes, for example in the response to a request that reads it, with those accepted when it is created or updated, then adding protected properties to those requests and checking whether the stored object changes. Client-side code, API documentation and error messages often reveal property names, and parameter discovery tools can guess others.
Remediation
Bind requests only to the properties a user is allowed to set:
- Accept input through dedicated input objects (data transfer objects or view models) that contain only the user-editable properties, and map them explicitly onto the stored entity.
- Where the framework binds directly to models, use an allowlist of permitted properties rather than a denylist, so that new properties are protected by default: strong parameters in Ruby on Rails,
$fillablerather than$guardedin Laravel,[Bind]with named properties or input models in ASP.NET,setAllowedFieldsin a Spring@InitBindermethod, and explicitfieldson Django forms and serialisers. - Mark sensitive properties as read-only in API serialisers, for example with
read_only_fieldsin Django REST Framework. - Change roles, ownership and financial values only through dedicated functions that carry their own authorisation checks.
Confirm the fix by resending create and update requests with added protected properties, and checking that they are ignored or rejected and that the stored object is unchanged.
References
Add This Finding to Your Library
In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.
Free trialYour trial starts when your portal goes live, not when you sign up, so the time you spend setting up does not count. · No card required
Only need the reporting? Our reporting tool is free and open source, with the same library.