CredManifest: App Registration Certificates Stored in Azure AD

Discovery & Impact

Karl identified a misconfiguration in Azure where Automation Account "Run as" credentials were stored in cleartext in Azure Entra ID (formerly Active Directory). This resulted in an impactful privilege escalation, as it would allow any user in this environment to escalate to "Contributor" of any subscription with an Automation Account.

Remediation Outcome

  • Karl responsibly disclosed the vulnerability to Microsoft who has since deployed updates that prevent cleartext private key data from being stored during application creation and prevents access to private key data previously stored.
  • NetSPI recommends cycling existing Automation Account “Run as” certificates, given the potential exposure of these credentials.
1

We identified an issue in the way the Automation Account "Run as" credentials were created when creating a new Automation Account in Azure.

2

Then, we manually extract credentials by copying the certificate data out of the manifest and converting it to a PFX file. We did this with two lines of PowerShell.

3

Next, we imported the certificate to our local store using PowerShell in a local administrator session.

4

Using the newly installed certificate, we authenticated to the Azure subscription as the App Registration.

5

We were able to run the Add-AzAccount command to authenticate to the tenant with the Directory (Tenant) ID, App (Client) ID, and Certificate Thumbprint values available.

6

Finally, we developed PowerShell script to automate extraction.