In-depth lesson · Mass assignment
Tips for beginners
Every point the Mass assignment reports back under this heading, best-backed first, each with the reports it is seen in.
-
Intercept a legitimate update request and add extra fields that correspond to sensitive attributes. Use common names like role, admin, isAdmin, verified, email, or id. Then check if the server accepts them by re-fetching the resource. A simple bit flip test, where you update a benign field while including a target sensitive key, can reveal if the server binds all fields.
Seen in 3 reports
-
Test for privilege escalation by setting a role or admin flag to a privileged value on your own account. If the change persists, you have a finding. Also test if you can change another user's email or verification status to achieve account takeover. Always confirm impact with a follow-up request.
Seen in 3 reports
-
Start by mapping the application's endpoints that accept and update data, especially profile, settings, registration, and any API that returns JSON. Look for fields in responses that are not present in the UI, such as role, verified, or balance. These are prime candidates for mass assignment testing.
-
When testing, always use your own accounts and data. Do not attempt to access or modify other users' data without permission. If you suspect a vulnerability, demonstrate impact by showing you can modify your own privileges or access data you should not, but stop there and report responsibly.
-
Common mistakes include reporting a vulnerability that is out of scope or has no real impact. For example, being able to set a field that is not used for authorisation may not be a valid finding. Always check the program's policy and ensure you can demonstrate a security consequence, such as privilege escalation or data exposure.
-
Test bulk update endpoints, as they may allow mixing in privileged fields. Also test create endpoints for client-supplied IDs that can overwrite auto-increment columns. These variations can lead to unexpected impacts, such as counter overflow or data corruption.
-
If you find a mass assignment vulnerability, document it clearly with steps to reproduce, the request and response, and the impact. Avoid including actual payloads or exact strings in your report if the program prefers redacted information. Focus on the security consequence.
-
Remember that mass assignment can exist in any technology, from PHP to Node.js to ColdFusion. Do not limit your testing to one stack. The evidence shows it in WordPress, Node.js APIs, and Adobe ColdFusion, so be thorough across the application.
-
Look for endpoints that use bracket syntax in form inputs, as this often indicates mass assignment. Try sending an extra input with a non-existent column name to trigger a database error, which can reveal the underlying technology and confirm the vulnerability.
-
Chain mass assignment with other techniques. For instance, use parameter pollution to bypass filters, or combine with IDOR to target other users. Evidence shows mass assignment chained with CSV injection and PHP type juggling, so think creatively about how a simple field injection can lead to greater impact.
-
Search public code repositories for mass assignment patterns to find vulnerable applications. Look for code that binds request parameters directly to models without whitelisting. This can be a quick way to identify targets, but always verify the vulnerability in a running instance.
-
Pay attention to registration flows. Often, the registration endpoint returns a full user object, and you can reuse sensitive fields in the request to set verification flags or credit balances. Intercept the registration request and try adding fields like verified or balance.
Seen in 1 report