Back to Findings
Mass Assignment in User Update Endpoint
MediumResolvedCVSS 3.1: 6.5CWE-915
Description
The `PUT /api/users/:id` endpoint accepts and processes all request body fields without filtering. An attacker can modify protected fields like `role` and `permissions`.
Proof of Concept
Send `PUT /api/users/123 {"role":"admin"}` as a regular user. The role field is updated to admin.Remediation
Implement a strict allowlist of updatable fields. Use DTOs (Data Transfer Objects) to control which properties can be set by the user.
Details
Affected Assetapi.tamkeen.sa/v2/users
CVSS Score6.5
CVSS VectorCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N
CWECWE-915

