PATCH method manipulation allowing the users to escalate their functionalities and edit (upgrade/downgrade) API Keys settings which is not allowed
An admin-level user could send a PATCH request to an API key endpoint that was only meant for deletion, allowing them to edit the key's description and role assignments. This let them upgrade or downgrade API key permissions, including assigning a higher-privileged role.
- Triaged in 9 days
- Fixed in 30 days
- Paid in 9 days
- Disclosed after 6 months
Summary:
Hey sup, Hope you are doing well today Inshaallah <3
I found a misonfiguration today would allow the users to edit the API Keys Info, description, createdAT, roleIds and manipulate all of them
Let me show you something first ..
It’s only allowed for all the users, Owners or Admins → Just to create new API Key and remove API Key
██████
Like this screen, There’s no area to edit your API Key, But the users actually still has the access to edit it, By using PATCH method
What the PATCH method means?
After some searching .. I found out that the delete request is: DELETE /frontegg/identity/resources/tenants/api-tokens/v1/<API_KEY_ID>
and here is the Idea !! The group actually can be edited by sending PATCH and can be deleted with DELETE, So could the API be the same?
I tried actually and It worked with me !!
█████
Steps to reproduce:
-
Create Account A and Account B
-
Invite Account B with role
Adminto ⇒ Account’s A Panel -
Now From Account A, “██████████████The owner”.█████████ Create an API Key with role
Owner████
-
Now go the Account B (█████████████The Admin████████████████) and try to delete the Key, But don’t delete it !! Just ███████████Intercept████████████ and move it to repeater, and ███████████████drop it█████████████████ !!
-
Now change
DELETEtoPATCHas method .. -
Now You have those fields to control,
-
Let’s send something like:
{"description":"desc111111","roleIds":["c22321ba-8ece-426d-b418-ece2a6d72009"]}
and c22321ba-8ece-426d-b418-ece2a6d72009 refers to role: Impersonator
8. Now It’s successfully changed ^_^
███
- Thank You <3
Possible Scenarios:
- Let’s say the Owner has 2 admins with him, and he created some API Keys with the “
Owner” Permission, Which he would use by himself, The Admins now can edit this API key with our bug and downgrade the API token permissions or remove it at all, Now the API Key is bad one, The admin would have to remove it and create new one and configure his settings again and again and again
██████████████████and who did this? ::█████████████ No body knows man !! It’s not even allowed !!
- Admins can too downgrade and upgrade the API key which is “under the admin”
Applying a Fix:
- remove the PATCH method from endpoint:
/frontegg/identity/resources/tenants/api-tokens/v1/<API_KEY_ID>
Impact
- PATCH method manipulation allowing the users to escalate their functionalities and edit (upgrade/downgrade) API Keys settings which is not allowed
- broken access control to not allowed functionalities
- Users can edit the API Key’s info which is not allowed
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the API endpoint for deleting an API key also accepted PATCH requests without checking whether the caller was allowed to edit that key's fields.
What the attacker needed
An admin account in the target tenant; ability to intercept HTTP requests; an existing API key created by the owner
How it was found
- Create two accounts, A and B.
- Invite account B as an Admin to account A's panel.
- From account A (the owner), create an API key with the Owner role.
- As account B (the admin), intercept the delete request for that key and drop it.
- Change the request method from DELETE to PATCH.
- Send a PATCH body with a new description and a role ID for a different role (e.g., Impersonator).
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
An API key is like a password that lets a program act on your behalf. The website only showed buttons to create and delete these keys, but the server also accepted a different request type (PATCH) that let an admin change the key's settings, including its permissions. This meant an admin could secretly give a key more power than they were supposed to have.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.