Actions
Bug #63
closedImproper Input Validation in /api/admin/add-role Allows Excessively Long Role Names (API-WEB)
Status:
Closed
Priority:
Normal
Assignee:
-
Description
The /api/admin/add-role endpoint does not enforce proper input length validation on the name field.
An attacker (or authenticated admin user) can submit extremely long strings (well beyond expected limits such as 50 characters), and the server accepts and processes the request successfully.
This indicates Lack of server-side validation
Steps to Reproduce
- Send a POST request to:
https://api.akinderwellness.com:4001/api/admin/add-role - Use a valid admin authorization token
- Provide an excessively long string in name field:
{
"name": "NEW ROLE WITH MORE THAN FIFTY CHARACTERS LETS CHECK ITNEW ROLE WITH MORE THAN FIFTY CHARACTERS LETS CHECK ITNEW ROLE WITH MORE THAN FIFTY CHARACTERS LETS CHECK IT..."
}
- Observe the response
Actual Result
Server accepts the request
Role is created successfully with oversized name
Expected Result
Server should reject input exceeding allowed length (e.g., 50 chars)
Return validation error like:
{
"error": "Role name must not exceed 50 characters"
}
Updated by Adhi Narayanan 19 days ago
- Status changed from New to Resolved
- % Done changed from 0 to 100
Updated by Vivek Kumar 18 days ago
- Status changed from Resolved to Closed
{"success":false,"message":"Role name must be a valid string"}
Actions