Day 7 of 2160 minShell WalkerHands-on lab

Day 7: Broken Access Control: IDOR and Mass Assignment

Taught by Mr Elite Updated

By the end of today you can

  • Explain IDOR and mass assignment in plain words and say why each is an access control failure
  • Change an identifier in Burp Repeater and prove you can read data that is not yours
  • Add extra JSON fields to a request and prove the server accepts them
  • Use an assistant to suggest fields to test, then confirm or reject each one with your own request

Warm-up

Answer from memory first, then tap to check. Recalling yesterday is what makes it stick.

On Day 6, what must you identify before choosing any XSS payload?

The injection context, meaning where your input lands: HTML body, an attribute, a script, or a DOM sink.

What counts as evidence for an XSS finding, as on Day 5?

Execution. You need to see the script run in the browser, not just see your input reflected.

Imagine you log in to a document service and open your invoice. The address bar says /documents/1042. You wonder what happens if you type 1041. If the page shows someone else's invoice, the app checked that you were logged in but never checked that the document was yours. That is one of the most common and most paid bug classes in bounty work.

Today you learn two close cousins. IDOR lets you reach other people's objects by changing an identifier. Mass assignment lets you set fields you were never meant to control, such as a role. Both are broken access control, and both are proved with a single edited request. Everything runs in the two SecurityElites labs.

The idea in plain words

Access control is the part of an app that decides who may do what. Authentication asks "who are you?". Authorisation asks "are you allowed to do this?". Broken access control means the second question is skipped or answered badly. The app trusts you because you have a valid session, and never asks whether this particular thing belongs to you.

IDOR
Insecure Direct Object Reference. The app uses an identifier you can see and change (like a number in a URL) and does not check you own the object it points to.
Mass assignment
The backend copies every field from your request into a database record, including fields the form never sends, such as role or is_admin.
Whitelist
A fixed list of fields the server is allowed to accept. Without one, attackers can add their own.
Object
Any record the app stores: a document, order, profile or message.

The impact question is always the same: who is harmed? For IDOR, it is the owner whose data you can read or change. For mass assignment, it is everyone, because a normal user can become an admin. Keep that in mind, because your mission asks for exactly one sentence on it.

Quick check

You are logged in as a normal user and change /orders/77 to /orders/78. You see a stranger's order. Which check is missing?

Watch me do it: an IDOR by hand

Here is the method I follow, using Burp from Day 5. I describe it generically so you can apply it in the lab. Only do this against the lab, never against a real site you have no permission to test.

bash
curl -s -H "Cookie: session=YOUR_LAB_SESSION" \
  http://LAB_HOST/documents/1041 | jq .
Replay the proof outside Burp. Replace LAB_HOST and the cookie with your lab values. If the body is not valid JSON, drop the jq part.

Mass assignment: the extra field

Now the second flaw. Many apps send JSON like {"username":"sam","email":"sam@x.test","password":"..."}. The developer's code takes that object and saves it straight into a User record. If the User record also has a role column, and you add "role":"admin" to your JSON, the server may save it. The form never showed that field, so nobody thought to block it.

The test is simple: replay the real request in Repeater with one extra field added, then check what the server did. The proof is the changed result, not the request being accepted. A 200 response alone proves nothing, since the server may simply ignore unknown fields.

json
{
  "username": "testuser1",
  "email": "testuser1@example.test",
  "password": "LabPass123",
  "is_admin": true
}
A signup body with one extra field. The first three fields are what the form sends. The last is the guess we are testing.

Quick check

You add "is_admin": true and the server replies 200 OK. Is that enough proof?

Using an assistant to suggest fields, then testing them

Guessing field names is where an assistant saves time. It knows the names developers commonly use. It does not know your target, so every suggestion is a hypothesis, which is the lesson from Day 3. Never paste real tokens, cookies or private data. In the lab, paste only the harmless signup body.

text
Here is a JSON signup body from a practice lab I am allowed to test:
{"username":"a","email":"a@example.test","password":"x"}
List 10 extra field names a developer might have in the user
record that control privilege or status. Names only, no explanation.
A safe prompt. It contains no secrets and asks for a list you will test, not an answer you will trust.

Your turn: the two labs

The first lab, idor-docs-1, is the IDOR practice. The second, mass-assignment-1, covers the field-injection flaw. Use the method above on each, and keep Burp open the whole time. The lab section below gives directions and hints without spoiling the result.

Your turn

IDOR

DocuShare only checks that you are logged in, not that a document is yours. That makes it the cleanest place to practise the Repeater routine: baseline, change one identifier, compare. After it, do mass-assignment-1 the same way, since the second lab is the other half of today's mission.

Open the lab in a new tab

What to try

What to notice

  • Which status code appears when you request an object that does not exist, compared with one that exists but is not yours
  • Whether the response names a different owner, which is your proof of harm
  • Whether the server echoes your extra field back or silently ignores it
  • How the account looks after signup once the right field is accepted

If it did not work

Treating any 200 response as proof

Check that the content really belongs to another user, or that your privilege truly changed. Note the evidence beside the request.

Adding many fields at once in the mass assignment test

Add one field per request so you know which one worked and can report it precisely.

Trusting the assistant's field list as fact

Treat each name as a guess. Only a server response you observed counts.

Pasting real cookies or tokens into a prompt

Use redacted placeholders as on Day 2. In the lab, paste only the harmless request body.

Saving a screenshot instead of the request

Copy the exact request as curl so anyone can replay it. Add a screenshot only as extra.

Recap

  • IDOR means changing an identifier to reach an object you do not own
  • Mass assignment means setting fields the form never offered
  • Both are authorisation failures, not authentication failures
  • Repeater lets you change one thing and compare against a baseline
  • An assistant can suggest field names, but your own request proves them
  • Save the exact request and write who is harmed in one sentence

Cheat sheet

Baseline
Send the unmodified request first so you know what normal looks like
Change one thing
Edit a single ID or field per request
403 or 404 on another ID
Ownership is probably checked
200 with another user's data
Likely IDOR, confirm the owner differs
Copy as curl command
Right click in Repeater to save a replayable proof
role, is_admin, isAdmin
Common privilege field names to test in mass assignment
Impact sentence
Who is harmed and what they lose

Before the next day

Mission: Two flaws, two proofs

Solve both labs and save the exact request that proves each flaw. The aim is evidence anyone could replay, plus a clear statement of harm, which is the habit that gets reports accepted. Work only in the labs.

About 40 min

You are done when: A folder with notes.txt holding two exact requests, one harm sentence for each, and the list of fields you tested, plus two screenshots.

Want more? After solving idor-docs-1, write a short curl loop that checks a range of IDs in the lab only and lists which ones return 200. Keep it to the lab and to a small range.

Quiz

4 questions. Your score is saved with your progress.

1. What is the core mistake behind an IDOR?

2. Why is a 403 on another user's document ID useful information?

3. An assistant lists ten privilege field names. What is the right next step?

4. Which result best proves mass assignment?

Finish the day

Mark the day complete to save your progress.

Go to Day 8

Tell someone you are doing this:WhatsAppXLinkedIn

Your notes

Private to this device. Write what you want to remember from today.