APIM Classic’s Secrets-Exposure Flaw: Three Things That Break When You Rotate Everything

The fastest way to turn a security advisory into a self-inflicted outage is to start regenerating keys before you know who's holding them. Here's how to audit whether you're running the vulnerable Classic tiers,…

APIM Classic's Secrets-Exposure Flaw: Three Things That Break When You Rotate Everything

Editor’s note (2026-11-25): This is a developing story. Treat the specifics below, affected tiers, whether exploitation was observed, whether a CVE exists, whether customers were individually notified, as what the current reporting states, not as settled fact. The single citable source at time of writing is Petri’s article; I could not independently confirm a matching Microsoft Security Response Center advisory. Follow Microsoft’s official Security Update Guide and your own Azure Service Health alerts for authoritative scope.

The fastest way to turn a security advisory into a self-inflicted outage is to read the words “rotate everything now,” open a terminal, and start regenerating keys before you’ve worked out who’s holding them.

That’s the trap with the Azure API Management Classic disclosure. My one citable source here is Petri’s write-up, which describes a flaw in the Classic tiers that allowed unauthorized access to management-plane functions and, through them, to secrets stored in affected instances. Two caveats before you act on that. I could not independently locate a matching entry in Microsoft’s Security Update Guide (msrc.microsoft.com/update-guide) at the time of writing, and Microsoft has not, in any source I can confirm, assigned a CVE identifier to this vulnerability. Treat that gap as a reason to verify against Microsoft’s official channel before you move, not as reassurance that nothing happened.

APIM is a gateway. Every secret in it is load-bearing for something downstream, and the rotation itself is the outage. So before anyone runs a single regenerate command, two questions matter more than the advisory does: are you even running Classic, and what could the management plane actually surface.

What is “Classic,” and are you running it?

Azure API Management doesn’t ship a SKU literally called “Classic.” The term is shorthand for the original dedicated tiers, Developer, Basic, Standard, and Premium, as distinct from the serverless Consumption tier and the newer v2 line (Basic v2, Standard v2, Premium v2) that run on a rebuilt platform. The Classic tiers share the old gateway architecture. That shared lineage is almost certainly why the flaw lands where it does.

Which exact tiers are in scope should come from Microsoft’s advisory, not from me, and since I can’t confirm one exists yet, this is reported detail, not verified fact. If and when Microsoft enumerates the tiers precisely, believe that over this. Until then, treat Developer through Premium as suspect and v2/Consumption as probably-not. Developer tier is the sharp edge here: people spin it up for a proof-of-concept, stuff real backend credentials into it, and leave it running in a subscription nobody’s looking at.

Don’t guess at your footprint one resource group at a time. The steps below are defensive audit steps, read-only inventory to work out whether you’re even in scope, nothing more. Resource Graph answers “what APIM do I have, and what tier” across every subscription you can read in one query:

run.shbash, zsh
# Defensive audit: inventory every APIM instance and its tier, tenant-wide
az extension add --name resource-graph 2>/dev/null
​
az graph query -q "Resources
| where type =~ 'microsoft.apimanagement/service'
| project name, resourceGroup, subscriptionId, location, sku = tostring(sku.name)
| order by sku asc" --first 1000 -o table

Anything whose sku is Developer, Basic, Standard, or Premium goes on the list. Then confirm a specific instance and inventory what it fronts:

run.shbash, zsh
az apim show -g rg-apim -n apim-prod \
  --query "{name:name, sku:sku.name, region:location}" -o table
​
az apim api list -g rg-apim -n apim-prod \
  --query "[].{api:name, path:path}" -o table

What could actually have been read?

This is where “rotate everything” needs a scalpel. Management-plane access to an APIM instance exposes several distinct classes of secret, and they are not all equally easy, or necessary, to rotate:

  • Subscription keys. The per-subscription primary/secondary keys your API consumers send in Ocp-Apim-Subscription-Key. Readable through the management plane, trivially. Assume exposed.
  • Named values flagged as secrets. This is the quiet disaster. Teams park backend API keys, connection strings, and shared secrets in named values with the secret flag set, then reference them in policies. If the management plane was readable, so were these.
  • Backend credentials. Anything configured on backend entities or injected via policy, client certs referenced, authorization headers, the lot.
  • Key Vault references. Named values can point to a Key Vault secret rather than store the value inline. This is the one piece of good news, and it’s conditional. The attacker doesn’t get your Key Vault from reading the reference metadata. But if the flaw let them read the resolved value, the secret APIM had already fetched and cached, then the Key Vault secret is exposed too, and you’re rotating in the vault, not just in APIM.

Enumerate the secret-bearing named values before you touch anything. The PowerShell module is clearer here than the CLI:

audit.ps1PowerShell
$ctx = New-AzApiManagementContext -ResourceGroupName 'rg-apim' -ServiceName 'apim-prod'
​
# Secret named values stored inline, these need rotating at the source system
Get-AzApiManagementNamedValue -Context $ctx |
  Where-Object { $_.Secret -eq $true -and $null -eq $_.KeyVault } |
  Select-Object NamedValueId, DisplayName
​
# Named values backed by Key Vault, check whether the resolved value was reachable
Get-AzApiManagementNamedValue -Context $ctx |
  Where-Object { $null -ne $_.KeyVault } |
  Select-Object NamedValueId, DisplayName, @{n='KeyVaultSecret';e={$_.KeyVault.SecretIdentifier}}

Do you actually have to rotate everything?

Here’s the honest answer the headline won’t give you: you rotate everything the management plane could surface, which is more than you think and less than “everything you own.”

Rotate, without argument: all subscription keys on affected Classic instances; every inline secret named value; any backend credential configured on those instances. These lived inside the blast radius and there’s no way to prove they weren’t read.

Rotate conditionally: Key Vault–referenced secrets. If Microsoft’s official guidance says the resolved values were exposed, rotate them in Key Vault, which also means re-issuing them in whatever system actually owns them. If it says only the management metadata was reachable, you may be able to spare yourself a vault-wide rotation. That distinction is worth waiting for authoritative wording on, because rotating a Key Vault secret that twelve other services consume is a much bigger blast radius than the APIM flaw itself.

About the urgency. According to Petri’s reporting, attackers accessed management-plane functions on affected Classic instances, but Microsoft has not, in any advisory I can cite, confirmed in-the-wild exploitation, nor published a list of affected instances, subscriptions, or regions. That changes the framing from “you were definitely hit” to “access was demonstrably possible and you can’t prove it wasn’t you.” For a gateway full of shared backend credentials, that’s still enough to rotate, the cost of assuming compromise is a planned cutover; the cost of being wrong the other way is finding out from someone else’s logs.

On notification: Microsoft has not disclosed whether affected customers were individually notified via Azure Service Health, portal notifications, or email, I’ve found no statement either way. Don’t wait for a personal phone call. Check your Service Health log and your tenant’s security contact inbox yourself, and assume access was possible.

Three things that break the morning you rotate

Rotation on a gateway isn’t a config change, it’s a coordinated cutover. Three things break, every time, and the 2 a.m. version of each is worse than the daytime one:

1. Every caller using the old subscription key gets a 401. Regenerating a subscription key is immediate and irreversible, there’s no --what-if on it. The standard move is two-phase: callers switch to the secondary key, you regenerate the primary, callers move back, then you regenerate the secondary. If callers are hardcoded to primary and you regenerate it cold, every one of them is down until redeployed.

audit.ps1PowerShell
# Irreversible. Stage your callers onto the secondary key FIRST.
New-AzApiManagementSubscriptionKey -Context $ctx `
  -SubscriptionId '<subscription-id>' -KeyType Primary

2. Backend calls fail the instant a named value changes. Update the secret in APIM and the policy picks it up, but the backend only accepts the new credential if you’ve already provisioned it there. Rotate the backend first, then APIM:

audit.ps1PowerShell
# Do this AFTER the backend accepts the new credential
Set-AzApiManagementNamedValue -Context $ctx `
  -NamedValueId 'backend-api-key' -Secret -Value '<new-secret>'

3. Key Vault rotation fans out past APIM entirely. If a referenced secret is shared, rotating it in the vault breaks every other consumer that didn’t get the memo. APIM will also need its managed identity to still hold get on the secret to re-resolve the new version, verify that before you rotate, not after.

The migration conversation you were avoiding

Classic isn’t deprecated, and this flaw doesn’t kill it, Premium in particular still has capabilities the v2 tiers don’t match. But if this incident is the first time you’ve inventoried where your API secrets live, that’s the real finding, not the vulnerability. The v2 tiers run on the newer platform and are where Microsoft’s investment is going; Consumption suits spiky, stateless workloads. Either is a reason to stop treating named values as a secret store and push credentials into Key Vault with the gateway holding nothing but a reference and a managed identity.

Because the lesson here isn’t “patch APIM.” Microsoft already did that, reportedly. The lesson is that you had plaintext backend credentials sitting in a gateway’s management plane, and the only thing standing between them and the internet was Microsoft’s code being perfect. It wasn’t. It never is. Rotate the keys, then go find every other place you made the same bet.