Azure Automation Elevation of Privilege Vulnerability (CVE-2019-0962)
Azure Automation RunAs accounts were granted overly broad permissions, so a user with the contributor role who could run runbooks could reach Key Vault secrets they were not personally allowed to see. The RunAs account acted as a service principal with wider access than the user running the runbook.
Originally disclosed on Microsoft
Description
An elevation of privilege vulnerability exists in Azure Automation “RunAs account” runbooks for users with contributor role. This vulnerability could potentially allow members of an organization to access Key Vault secrets through a runbook, even if these members would personally not have access to that Key Vault. To exploit this vulnerability, an attacker must be a member of an organization who can run runbooks, with only global admins/co-admins who can create the “run as” account. Microsoft is addressing the vulnerability by providing the following scripts for existing RunAsAutomation accounts that modify existing roles by excluding access to KeyVault within Azure Automation account. https://www.powershellgallery.com/packages/Check-AutomationRunAsAccountRoleAssignments https://www.powershellgallery.com/packages/Update-AutomationRunAsAccountRoleAssignments https://www.powershellgallery.com/packages/Extend-AutomationRunAsAccountRoleAssignmentToKeyVault
FAQ
- What is Azure Automation? Azure Automation is an Azure service which executes PowerShell and Python runbooks on behalf of a user. As part of the Azure Automation service, a “RunAs account” may be created. The “RunAs account” is a Service Principal – an Azure Active Directory app which can execute actions on a user’s behalf. Azure Automation can use RunAs accounts inside of Azure Automation runbooks to access Azure resources in a programmatic way. 2. What do I need to do to protect my service against this vulnerability? Microsoft is providing scripts that help users to: Restrict Automation RunAs accounts from accessing Key Vaults. Selectively grant Automation RunAs accounts permissions for specific Key Vaults. These scripts can be further customized by users to their individual needs. 3. Where can I find these scripts? https://www.powershellgallery.com/packages/Update-AutomationRunAsAccountRoleAssignments https://www.powershellgallery.com/packages/Extend-AutomationRunAsAccountRoleAssignmentToKeyVault For more information about limiting Run As account permissions, see Manage Azure Automation Run As accounts . 4. How do I know if I need to run the script for RunAs accounts? Microsoft has provided a script to help users determine if they are affected: Check permissions on RunAs accounts: https://www.powershellgallery.com/packages/Check-AutomationRunAsAccountRoleAssignments
Azure
Azure
Microsoft
Microsoft
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 RunAs account's role assignments included access to Key Vault, so anyone able to run a runbook inherited that broader access regardless of their own permissions.
Impact
A contributor-level member could potentially read Key Vault secrets through a runbook despite lacking personal access; Microsoft addressed it by providing scripts that remove Key Vault access from existing RunAs accounts.
What the attacker needed
Member of the organisation; can run runbooks; contributor role
The fix
Microsoft provided scripts to check and update existing RunAs account role assignments so they no longer grant Key Vault access, with optional selective grants.
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.
Azure Automation lets people run small scripts, called runbooks, inside Microsoft's cloud. Those scripts can run under a special robot identity, a RunAs account, which had more access than the person starting the script. So someone with limited rights could use the robot to read secrets stored in Key Vault that they were not supposed to open.
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.