pentesting, updated

Testing for Mass Assignment

Check whether an API blindly binds every field in a request body to an object, letting you set fields you shouldn't control.

Goal

Confirm write endpoints only accept the fields they expose in documentation/UI, not every field the underlying object has.

How to test

Take a legitimate update request and add extra fields that plausibly exist on the object but aren’t in the normal form:

curl -s https://example.com/api/profile -X PATCH \
  -H "Content-Type: application/json" \
  -d '{"name":"test","role":"admin","isVerified":true,"balance":99999}'

What to look for

Any of the extra fields taking effect — confirms the endpoint binds the full object instead of an allowlisted subset.

References

§ home
~/knubertus/home/
1,1 Top