mass assignment
A bug where a handler copies every field of a request body into a data model, so a caller can set fields such as role or balance that were never meant to be writable.
A caller can promote themselves or rewrite money and ownership fields in one request.
In more detail
It turns a convenience, such as copying the whole body with update, into a way to set role, balance, owner or status. The fix is a per-operation allowlist of writable fields, rejecting unknown fields loudly, and responses built from named public fields.
Examples
In the course a signup request with role admin and balance 9999 produces a rich administrator, and an update rewrites status and owner.{"name": "mallory", "role": "admin", "balance": 9999} sent to a signup endpointRelated terms
- broken object property level authorization — OWASP's name for letting a caller read or write individual fields of an object they may access but should not see or change.
- allowlist — An allowlist names exactly what is permitted and a denylist names what is forbidden, with everything else allowed.
- serialization — Turning an in-memory object into bytes, such as JSON text, that can be sent or stored, and parsing it back again.
Taught in
- Mass Assignment — Application Security & Threat Modeling for Engineers