Cybersecurity glossary

What is Mass Assignment?

Learn what mass assignment is, how APIs bind client fields onto sensitive object properties, real-world privilege escalation examples, and allowlist patterns that stop unauthorized writes.

Application securityUpdated July 23, 2026
Also known asOver-postingAuto-binding vulnerabilityObject injection via parameters

Definition

Mass assignment is a vulnerability where an application automatically binds client-supplied input to internal object properties without an allowlist—letting attackers modify privileged fields such as roles, prices, or ownership by including unexpected parameters in requests.

Why mass assignment matters

Developer frameworks love convenience: take JSON, hydrate an object, save. Mass assignment is that convenience without a filter—client input becomes internal state, including fields no user should control.

A single extra property in a PATCH body can equal privilege escalation.

How mass assignment happens

Entity binding

Controllers bind request bodies directly onto ORM models.

Open update payloads

Schemas allow additionalProperties or untyped maps.

Shared create/update models

Admin-only fields exist on DTOs reused by user endpoints.

Nested object updates

Deep merges let clients overwrite privileged child attributes.

Typical exploit path

1

Observe legitimate update traffic

Learn which endpoint updates profiles, orders, or settings.

2

Identify privileged property names

Infer from docs, JS bundles, excessive responses, or common conventions.

3

Inject extra fields

Add role, price, or ownership properties to the JSON body.

4

Submit as a normal user

Authenticate with low privilege and send the crafted update.

5

Confirm persistence

Re-fetch the object and verify the privileged field changed.

6

Escalate and automate

Use the new privileges or script the pattern across accounts.

Safe binding patterns

PatternVerdictReason
Bind to ORM entityUnsafeExposes all columns as writable
Allowlist DTO fieldsSafeOnly intended properties exist
Schema additionalProperties:falseSafe aidBlocks undeclared JSON keys early
Denylist a few fieldsFragileNew privileged columns get missed

Mass assignment prevention checklist

  • Use dedicated request DTOs with explicit allowlisted properties.
  • Never bind client input directly onto persistence entities.
  • Prefer allowlists over denylists for writable fields.
  • Reject unknown properties in schema validation for write APIs.
  • Authorize sensitive fields server-side even if present in admin DTOs.
  • Add regression tests that attempt privileged field injection.
  • Review GraphQL input types for accidental privileged arguments.
  • Monitor update payloads for unexpected property names.

The practical takeaway

Mass assignment lets clients write properties they were never meant to control. Framework convenience is not an authorization strategy.

Allowlist writable fields, validate schemas strictly, and treat unexpected properties as hostile by default.

Related security terms

Frequently asked questions

What is mass assignment in simple terms?

The server copies whatever JSON fields you send onto a database object. If you add isAdmin:true and the binder accepts it, you become an admin.

Is mass assignment only a Rails/ASP.NET issue?

No. Any stack with automatic request-to-object binding can be vulnerable—including Node, Java, PHP, and GraphQL mutation inputs.

How is it different from BOLA?

BOLA is about accessing the wrong object. Mass assignment is about writing the wrong properties on an object you may already access.

What fields are commonly abused?

role, isAdmin, verified, balance, price, accountId, tenantId, and feature flags.

Does using DTOs fix it?

Yes when DTOs expose only safe writable fields. Reusing persistence entities as request bodies often reintroduces the bug.

Can GraphQL mutations be mass-assigned?

If input types include privileged fields and resolvers pass them through unchecked, yes.

How do you test for it?

Add unexpected privileged properties to create/update requests and verify they are ignored or rejected.

References

Explore authoritative guidance and frameworks related to mass assignment.

Explore every security definition

Return to the glossary to search by term, alias, starting letter, or security category.

Browse glossary