PATCH/POST users/levels doesn't check group IDs. Argument is unchecked written to database and can cause exceptions in backend afterwards. Validate that all group IDs are numeric and refer to existing groups; fail otherwise.
curl -k -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -w "\nHTTP status: %{http_code}\n" -X PATCH 'https://localhost:7154/api/index.php/v1/users/levels/1' -d '{ "rules": [ "Public" ] }'
curl -k -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -w "\nHTTP status: %{http_code}\n" -X PATCH 'https://localhost:7154/api/index.php/v1/users/levels/1' -d '{ "rules": 1 }'
curl -k -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -w "\nHTTP status: %{http_code}\n" -X PATCH 'https://localhost:7154/api/index.php/v1/users/levels/1' -d '{ "rules": [ 42 ] }'
curl -kH "Authorization: Bearer $TOKEN" -w "\nHTTP status: %{http_code}\n" -X POST 'https://localhost:7154/api/index.php/v1/users/levels' -d '{
"title": "Test2",
"rules": [ 4711 ]
}'
Tested with 5.4-dev branch.
Found in testing #46080. This may be a minor priority.
| Labels |
Added:
No Code Attached Yet
|
||
| Labels |
Added:
bug
Webservices
|
||