← Mass Assignment lesson
FoundationsMass AssignmentIntermediate35 min+100 XP

Ticket Assignee

The Ticket Desk copies every field from the profile request into the user record. Grant yourself administrative access.

“The form asked for a name. The parser accepted a promotion.”

CWE-915OWASP API Security API3:2023OWASP ASVS 5.1.1
The story
A form is a suggestion to the user. The server's object binder decides which fields are real. If it copies every key, the attacker can add keys the UI never displayed.

Frameworks often bind request bodies directly to models. Hidden fields such as role, tenant, balance or verified are accepted because the model has them, even though the form does not.

Your objective
  • Inspect the profile update request
  • Add a field the form does not show
  • Reach the admin console and capture the flag
Boundary under test

Client JSON to allowed request fields

Field guide · request anatomy

Where to look before you type a payload

01Receive

Parse the body into a generic map or an over-permissive model.

02Bind

Copy every supplied key onto the domain object, often recursively.

03Guard

Apply validation to the fields the developer remembered, not to the full input shape.

04Persist

Save the object, including fields the client should never control.

Progressive hints

Open one hint at a time. The first two build the model; the last two point at the boundary.

Hint 1

Inspect the profile update request.

Hint 2

Add a field the form does not show.

Hint 3

The update handler merges every JSON field. Add "role":"admin" to /update.

Hint 4 · near the answer

Set the role to admin and open the admin console.

Guided workbench

Observe → Hypothesize → Test → Prove → Explain

This is the same loop a reviewer expects in a report. Your draft stays in this browser; nothing is submitted until you choose to export it.

0/15steps complete
Observe0/3
Hypothesize0/3
Test0/3
Prove0/3
Explain0/3

Evidence log

Write for a reviewer who was not in the room. Every claim needs a request, response or state change behind it.

Preview the evidence report
# Lab evidence report — Ticket Assignee

- Family: Mass Assignment
- Lab ID: web-mass-ticket
- Date: 2026-12-05

## Workflow

### Observe

- [ ] Open "Ticket Assignee" and record /update, the HTTP method and the role you are given.
- [ ] List every parameter, header, cookie and object identifier the normal flow exposes.
- [ ] Save a baseline response: status, body shape, timing and the fields that change by user.

### Hypothesize

- [ ] Name the server decision that protects /update, and the evidence it should use.
- [ ] Use the clue as a constraint, not an answer: The update handler merges every JSON field. Add the role field to the request body.
- [ ] Predict the exact status, body or state change that would prove the decision is missing.

### Test

- [ ] Start from the baseline and change one value: the role field on /update.
- [ ] Keep the request replayable; vary encoding, method or identifier location only after the first result.
- [ ] Capture the full request and response for the winning attempt, including the flag.

### Prove

- [ ] Capture the flag and name the exact foreign object, role or state change it proves.
- [ ] Repeat from a clean session and confirm the result is not cached or stale.
- [ ] State impact precisely: what data or action did you actually obtain?

### Explain

- [ ] State the root cause without naming the payload: which decision failed?
- [ ] Name the control that prevents recurrence and the layer where it belongs.
- [ ] Write one regression test that fails before the fix and passes after it.

## Evidence

### Target and baseline

_Not recorded._

### Hypothesis

_Not recorded._

### Winning request

_Not recorded._

### Proof

_Not recorded._

### Root cause

_Not recorded._

### Control and regression test

_Not recorded._

## Analyst conclusion

The proof demonstrates the missing control above. The regression test should fail against the vulnerable behavior and pass after remediation.
Solution and debrief
Locked until you capture the flag.

The full request, the reasoning and the debrief unlock after a successful capture. That is deliberate: struggle first, then consolidate.

What a reviewer will ask

False positives to rule out

  • The field is absent from the HTML form: the API may still accept it.
  • The response omits role after the update: inspect the database effect or the next authorization decision.
  • The server rejects an unknown top-level field: test nested objects and alternate content types.

Regression tests to name

  • Privileged field: The request is rejected and the role is unchanged
  • Tenant field: The server ignores or rejects the field and keeps tenant A
  • Nested relation: Strict validation rejects the entire request
The defender's move
  • Bind only an explicit allowlist of fields.
  • Validate with a strict schema and reject unknown keys.
  • Never expose privileged fields on a user-writable model.
See the secure-code pattern and all 4 regression tests →
الخلاصة

النموذج اقتراح، وما يقبله الـbinder هو الحقيقة.