Skip to main content
Back
DemonstrationMicrosoft Entra · Azure
5 min read

Datadog Security Labs' Key Vault Contributor escalation to secrets on Azure

Environment
Azure key vaults that use the access policy permission model, as staged by Datadog Security Labs; no company was named
When
Test date not stated; reported to MSRC Oct 25, 2024Disclosed Dec 16, 2024
Entry
A user account assumed to be phished through an adversary-in-the-middle sign-in link, holding Key Vault Contributor over a resource group.

Datadog Security Labs showed that the Azure Key Vault Contributor role, which Microsoft documented as unable to access secrets, keys or certificates, could add its holder to the access policy of any key vault that uses the access policy permission model. In a staged test that assumes a systems administration user was phished through an adversary-in-the-middle link, the attacker added its own identity with all permissions and read the vault's secrets, including an application API key. Microsoft closed the report as not a vulnerability and added a warning to the role documentation; the write-up does not say whether the behavior changed.

What the demonstration did

External Parties
AiTM proxy (assumed)
Internet
Microsoft Entra IDsession tokens
Application Resource Group · Azure
Systems Admin User
Vault Access Policy
Vault Secrets

Replaying Datadog's Key Vault access policy demonstration / reported to MSRC October 2024; the run date is not stated

  1. 1

    Phished administrator session

    Assumed by the scenario; not staged

    The scenario assumes that a systems administration user signs in through an adversary-in-the-middle link and that the attacker takes the user's session tokens.

  2. 2

    Access policy self-grant

    Test date not stated

    Seeing that the user's roles give no data access, the attacker uses Key Vault Contributor's Microsoft.KeyVault/vaults/write permission to add its own identity to the vault's access policy with all permissions.

  3. 3

    Secrets read

    Test date not stated

    The new access policy entry authorizes the attacker's data plane requests, and the attacker reads the vault's secrets, including an application API key.

Impact

In the staged test, a Key Vault Contributor documented as having no data access added itself to a vault's access policy and read the vault's secrets, including an application API key. Microsoft closed the report as not a vulnerability and added a warning to the role documentation; the write-up does not say whether the behavior changed, and it reports no use in the wild.

Outcome

Where cloud-provider controls fit

In Microsoft Entra ID, a Conditional Access policy that requires the phishing-resistant MFA authentication strength for your administrators would have refused the relayed sign-in the scenario assumes, so no session would have reached your key vault. In Azure, an Azure Policy assignment that denies vault and access policy writes caps the self-grant only where your phished user sits outside its exemption, which the write-up does not say, and a read-only resource lock blocks updates of the vault, though Microsoft's lock documentation does not name access policy changes. Key Vault network rules with public network access disabled limit secret reads to your private endpoints; the write-up does not say where the requests came from. In the test, the role added itself to the access policy and read the vault's secrets, including an application API key.

Would the controls have stopped it?

In hindsight, not as a whole. 1 control would have refused a step outright, and 3 controls would have limited one. The counts below are control assessments, not attack stages: several can address the same step. The same replay with the controls in place before the incident shows where each phase would have been refused or bounded.

1
Prevented
3
Contained
0
Not covered

How it could have been prevented

The same replay with the controls in place. Green marks where a step is refused, blue where it is bounded, and red where no control reaches it. Open a row to read the control, why it acts, and its caveat.

External Parties
AiTM proxy (assumed)
Internet
Microsoft Entra IDsession tokens
Application Resource Group · Azure
Systems Admin User
Vault Access Policy
Vault Secrets

Replaying Datadog's Key Vault access policy demonstration / reported to MSRC October 2024; the run date is not stated

1 · Phished administrator session

1 Prevented3 on other clouds

2 · Access policy self-grant

2 Contained3 on other clouds

3 · Secrets read

1 Contained3 on other clouds

Key facts

  • Datadog Security Labs reported the behavior to MSRC on October 25, 2024, and published its write-up on December 16, 2024
  • Microsoft documented Key Vault Contributor as managing key vaults without access to secrets, keys or certificates, yet the role held Microsoft.KeyVault/vaults/write, the permission the write-up names for the access policy change
  • A test user holding Key Vault Contributor had no direct access to the vault data before the change; after adding itself to the access policy, it could get, list and update all of the vault's data
  • The phishing of the systems administration user through an adversary-in-the-middle link was assumed by the scenario, not staged, and the write-up does not say how the read API key would have been used
  • Microsoft added an access policy warning to the Key Vault Contributor documentation on October 31, 2024, and MSRC closed the case as not a vulnerability on November 11, 2024
  • The write-up reports no use of the technique in the wild and does not say whether the behavior itself changed

Sources

Every fact in this breakdown comes from the public reporting below. The replay is a model of that reporting, not a reconstruction of the environment it describes.

  1. 1.
    Escalating privileges to read secrets with Azure Key Vault access policiesDatadog Security Labs · Dec 16, 2024 · ResearchRole permissions, access policy self-grant, secret read, MSRC timeline, Microsoft documentation change, recommendations

The estate in the replay follows the researchers' description of their own test environment. Verdicts describe what a control does when it is in place before the run. They are not an assessment of any company's security program.

More cloud attack breakdowns

All breakdowns