Mass Assignment

High

Mass Assignment

Definition

Mass Assignment is a vulnerability that occurs when an application automatically binds the values of an HTTP request to the fields of a data model or object without filtering which fields may be modified. An attacker can add extra fields to the request to change sensitive attributes such as role, status or price.

Impact

Privilege escalation (changing role to admin)Bypassing payment restrictions (changing price to 0)Modifying account verification statusAccess to premium features without payingModifying data that should not be user-editable

Examples

Mass Assignment for privilege escalation

The profile-update endpoint accepts any field from the body and passes it straight to the ORM. The attacker adds fields such as 'role' or 'verified' that don't appear in the form but that the model does accept.

# Legitimate profile-update request
PUT /api/users/me
Content-Type: application/json
{"name": "John", "email": "john@example.com"}

# Request with extra fields (Mass Assignment)
PUT /api/users/me
Content-Type: application/json
{"name": "John", "email": "john@example.com", "role": "admin", "verified": true}

# If the backend does: User.findByIdAndUpdate(userId, req.body)
# Without filtering req.body, the attacker becomes admin

Practice Mass Assignment with real labs

Apply what you've learned in safe environments based on real bug bounty reports.

See practice labs
2,482

hunters training

62

labs from real hacks

1,630

completions

$14,790

paid out for these bugs

11 flags captured this week·Real hacks from HackerOne · YesWeHack · Bugcrowd·No commitment·Free Academy
Free · no account

The checklist I run on every new target

47 checks ordered by cost: first what can get you in trouble, then the cheap stuff, and finally the expensive stuff — which is where the big bounties are. I'll send it to your inbox right now.

Unsubscribe in one click, from any email.

BBLabs · bug bounty training

Stop reading about bugs and start hunting them

Create your free account and practice on labs based on real hacks that paid out thousands of euros. The Academy is free forever.

No card · free Academy · cancel anytime