Mass assignment is proven when a field you added to a request body persists on the record, most usefully role, orgId, plan or credits. The proof is the re-read after the write, not the write's own response.
Where this class of bug actually lives in a create or update endpoint
- Whole-body binding. Rails
permitlists, Laravel$fillable, Djangofields = '__all__', Expressreq.bodyspread, Gojson.Decodeinto a model. - Nested attributes. A request that creates associated records through the parent, including records the endpoint never intended to expose.
- Registration. A signup body with
"role":"admin"or"plan":"enterprise". This is the highest-severity version and the easiest to test. - Invitations and team invites. A body carrying
tenantIdthat decides which workspace the new user lands in.
What to try first
- Add each privileged field to a valid update body, one at a time, and re-read the record after each.
- Repeat on registration, on invite-accept, and on any bulk import.
- Try nested objects for associations:
{"account":{"plan":"enterprise"}}. - Watch for a 200 that silently ignores the field versus one that stores it — both look like success in the response.
A reproduction you can keep
Send it, then read it back. The response to the write is not evidence:
curl -sS -X PATCH https://staging.example.com/api/users/me \
-H 'Authorization: Bearer ***' -H 'Content-Type: application/json' \
-d '{"name":"Alice","role":"admin","plan":"enterprise","credits":9999}'
# the proof is here, not above
curl -sS https://staging.example.com/api/users/me -H 'Authorization: Bearer ***'
# vulnerable: role=admin, plan=enterprise, credits=9999
# fixed: name only; the rest unchanged from before the requestWhat "fixed" has to look like
Bind the request to an explicit DTO of writable fields, so anything else is rejected or dropped before it reaches persistence. Verify by re-reading the record and confirming the privileged fields are unchanged, including on the registration and invite paths.
Where people get this wrong
- Validation that strips unknown keys is only a fix when the parsed output is what gets saved.
- A read-only serializer and a writable serializer built from the same model quietly share the field list.
- Fixing the update route and leaving registration open is the usual partial fix.
What Offense does here
Offense runs an agent swarm against your app in a disposable sandbox, keeps the request, the identity and the vulnerable response as evidence, and replays the same attack after the fix so the retest is a control comparison rather than a green check. It does not read your source and it does not patch your code: the finding goes to your coding agent with the reproduction attached. The hosted workspace is invite-only — join the waitlist — and the free dependency audit in /install needs no account.
Questions this page answers
Why is mass assignment severe on registration?
Because the account is created with the attacker's chosen privileges, before any other control applies.
Does a 200 mean the field was accepted?
No. Many frameworks accept the body and drop unknown fields. The re-read is the only evidence.
Written by Offense Research, reviewed December 2, 2026. Correct something? Email imran@offenseresearch.com.