CVE-2021-42306 CredManifest: App Registration Certificates Stored in Azure Active Directory
Azure Automation Account 'Run as' credentials (PFX certificates) were stored in cleartext in Azure Active Directory App Registration manifests, accessible to any AAD user who could read App Registrations. An attacker with a low-privileged AAD account could extract the certificate and authenticate as the App Registration, typically gaining Contributor access to the subscription.
Published on netspi.com
Technical / Cloud Pentesting
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
Root cause
Likely a logic error in Azure's Automation Account creation process caused the full PFX file (including the private key) to be stored in the App Registration manifest instead of only the public key.
Impact
Any user in the Azure AD tenant could read the certificate and escalate to Contributor on any subscription containing an Automation Account, potentially compromising the entire subscription.
What the attacker needed
An Azure AD user account (any member user); An Automation Account with a 'Run as' account; Ability to read App Registration manifests
The fix
Microsoft deployed updates to prevent cleartext private key storage and block access to previously stored private keys; additionally, affected organisations should cycle their Automation Account 'Run as' certificates and remove old ones.
How it was found
- Create a new Automation Account with a 'Run as' account in Azure.
- Navigate to the App Registration's Manifest section and locate the keyCredentials value.
- Copy the Base64-encoded certificate data from the manifest.
- Convert the Base64 string to a PFX file using PowerShell.
- Import the PFX certificate into the local certificate store.
- Authenticate to Azure using the certificate with Add-AzAccount, specifying tenant ID, app ID, and thumbprint.
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.
When you create an Azure Automation Account with a 'Run as' account, Azure creates a certificate (a digital key) that lets the automation log in to your subscription. Due to a bug, the full certificate file, including its private key, was stored in a place that any normal user in the same Azure Active Directory could read. That meant a low-privileged user could copy the certificate and use it to log in as the automation account, which often has Contributor rights over the subscription.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.