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
hunters training
712

hunters training

labs from real reports
55

labs from real reports

completions
1,206

completions

in bounties practiced
$213,970

in bounties practiced

46 flags captured this week·Real reports from HackerOne · Bugcrowd · Intigriti·No commitment·Free Academy
BBLabs · bug bounty training

Stop reading about bugs and start hunting them

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

No card · free Academy · cancel anytime