*Azure Privilege Escalation Via Service Principal*
A user with the Application Administrator role could add a new credential to a service principal that held the Privileged Role Administrator role, then authenticate as that service principal and grant themselves Global Administrator. This allowed escalation from a compromised application administrator account to full tenant control.
Published on infosecwriteups.com
In this blog, we will look at a variation of a real-world attack path to escalate our privileges from a compromised Application Administrator account in Azure to Global admin through a service principal.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Impact
An attacker with a compromised Application Administrator account could escalate to Global Administrator, gaining full control over the Azure tenant.
What the attacker needed
Compromised Application Administrator account; PowerShell with Az and AzureAD modules; service principal with Privileged Role Administrator role
How it was found
- Connect to Azure AD with the compromised Application Administrator account.
- Verify the account has the Application Administrator role.
- Identify that the MYAPP service principal has the Privileged Role Administrator role.
- Add a new password credential to the MYAPP service principal.
- Authenticate as the MYAPP service principal using the new credential.
- Use the service principal's Privileged Role Administrator role to add the APPADMIN user to the Global Administrator role.
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 write-up has not been written yet. The Original tab links to the source.
In Azure, an application can have a robot identity called a service principal, which logs in with a secret. If that robot identity has a powerful admin role, anyone who can add a secret to it can act as the robot and use those powers. Here, a user who could manage applications added a secret to a powerful service principal and then used it to make themselves a global admin.
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.