Insights / Keys and machine identities
Azure API Management vulnerability: what to rotate now
Konstantins Feofantovs, Founder, rebuildstack ·
Microsoft closed the Azure API Management Classic flaw, but secrets read before the fix still work. What to rotate, in what order, and which logs to check.
Key points
- Microsoft closed the path on 19 November, but secrets read before the fix stay valid until you rotate them at their issuer.
- Rotate identity provider and OpenID Connect client secrets, backend credentials in Named Values and subscription keys, and disable the retired direct management API.
- Move what remains into versionless Key Vault references or managed identities, and give every secret an expiry.
What happened in Azure API Management?
On 18 November 2026 Microsoft identified a flaw in Azure API Management (APIM) Classic and deployed a mitigation the next day. Microsoft told affected customers through a Service Health advisory, tracking ID MZK9-GH0, that is not published on a public page; its wording here is as quoted in press coverage of the advisory. In it, Microsoft said an unauthorized party could have used the issue to access secrets stored in Classic instances that were not configured according to Microsoft's security best practices [1]. The affected tiers are Developer, Basic, Standard and Premium. The Consumption tier and all v2 tiers are not affected [1].
Microsoft closed the access path on 19 November and rotated the keys and credentials it controls where appropriate. It also said the fix does not invalidate customer credentials that were accessed before it [1]. The advisory tells customers to rotate exposed credentials, investigate suspicious activity and review their logs [1]. Separately, in a statement to the press, Microsoft said the fix itself required no customer action. That line is easy to misread: nothing had to be done for the hole to close, but a lot has to be done about what may already have left through it.
The exposed categories, per the advisory, are secrets stored in Named Values, client secrets for identity providers, client secrets for OpenID Connect providers, subscription keys, and tokens used to call the direct management API [1].
Norway's National Security Authority (NSM) published its own advisory on 20 November and updated it on 23 November. NSM says an unknown actor actively went after access tokens, secrets and named values in APIM, that the Norwegian energy sector found the flaw first, and that several sectors in Norway and organizations abroad are affected. NSM names Equinor and Skagerak Energi among the organizations hit and credits Equinor with the early discovery. NSM has also raised Norway's national cyber risk level to HØYT (high), and says it is still unclear how widely the flaw was exploited [2]. Its instruction is blunt: everyone running Azure API Management should assume their secrets and named values are exposed and rotate all tokens and secrets [2].
Equinor disclosed an ongoing cyber attack on certain IT systems on 17 November, a day before Microsoft identified the flaw, and later said it had been stopped with no indication that data was stolen or altered [10]. Equinor's own statement does not mention API Management or Microsoft; the link comes only from NSM. It is the earliest public date in this incident.
What is not public: a CVE, the exact misconfiguration Microsoft refers to, when exploitation began, and how many tenants were read. On 21 November Microsoft published a public guide to rotating every credential type APIM holds [3].
Why did it work?
An API gateway sits between callers and backends, so it has to hold whatever the backends ask for: an API key for a payment provider, a client secret for an identity provider, a connection string for a logging pipeline. In APIM those mostly live as Named Values, and a Named Value can be one of three types: Plain, Secret (encrypted by API Management), or a reference to a secret in Azure Key Vault [4].
The first two keep a copy of the credential inside the gateway. Encryption at rest protects that copy from someone reading the disk. It does nothing against a path that lets someone ask the service to hand the value over, which is the class of failure here.
The third type still leaves a resolved value in the gateway at runtime, so Key Vault references are not immune to a flaw like this, and NSM's advice to rotate covers every named value [2]. What a Key Vault reference changes is everything after the leak: the secret has one source, rotation happens in one place, and reads of the secret land in Key Vault's own audit log [4].
Microsoft's own documentation adds a quieter point. A user who can edit policies can read the contents of any named value by referencing it in a policy, even without read access to the named value itself [4]. Policy write is secret read. Most role reviews do not treat it that way.
Does this apply to you?
- Do you run any APIM instance on the Developer, Basic, Standard or Premium Classic tier, in any subscription, including old test ones?
- Does any named value hold a credential as Plain or Secret rather than as a Key Vault reference?
- Does the developer portal sign users in through an identity provider or an OAuth 2.0 or OpenID Connect server that uses a client secret?
- Is the legacy direct management API still enabled on any instance?
- Do your APIM resource logs and Activity Log go to a Log Analytics workspace, and how far back do they reach?
If the first answer is yes, the rest of this article applies to you.
What to do this week
- Confirm the instance is patched. NSM gives a check: open the internal status page on your gateway hostname (
https://<your-gateway-hostname>/internal-status-0123456789abcdef) and readRuntimeVersion. On Classic it has the form 0.52.x or 0.53.x, and the third number decides: 0.52 is patched at 31936 or higher, 0.53 at 31938 or higher. Lower numbers are still vulnerable, and NSM advises contacting your provider directly if yours is. A four part string such as 0.53.4608.0 or 0.52.4150.0 belongs to a v2 or Consumption instance, which is not vulnerable [2]. - Inventory before you rotate. List every named value, backend credential, subscription, identity provider, OAuth or OpenID Connect server, logger and self-hosted gateway on each Classic instance. For each one, write down who issued it and what sits behind it. NSM asks for the same mapping of data behind the instance, to size the damage if compromise is confirmed [2].
- Rotate at the issuer, then in APIM. Microsoft's guide is explicit that updating the value in API Management does not revoke the old credential at its issuer. The order it gives is: create the replacement at the issuer, update APIM, test, then revoke the old one [3]. A new value in the gateway with the old one still valid at the backend closes nothing.
- Start with what reaches furthest. Identity provider and OpenID Connect client secrets usually belong to app registrations in Microsoft Entra that may hold permissions well beyond the portal; Microsoft's guide rotates them with an appended credential and deletes the old one after a test [3]. Then backend credentials in named values, including backend client certificates, then logger connection strings such as Event Hubs, then any secret written inline in a policy, then subscription keys, which have a primary and secondary pair so callers can move without downtime [3]. Regenerate self-hosted gateway keys too, which the control plane can also return [5]. For the direct management API, Microsoft retired it on 15 March 2025 and tells customers to disable it if it is still enabled [9]. If nothing still calls it, disable it rather than only rotating its keys.
- Replace stored copies with references. While each secret is being rotated anyway, move it into Key Vault and reference it from the named value with a versionless secret identifier. APIM then picks up a new version within four hours, and a pinned version never rotates [4]. This integration is not available in workspaces yet [4]. Where the backend supports it, Microsoft's guide goes one step further: use managed identities instead of keys and connection strings [3].
- Shorten what stays. For whatever still has to be a secret, set an expiry at the issuer and automate the rotation, so a copy taken today is worthless in weeks rather than valid for years. Keys you hand to other companies need the same end date, as the Barracuda intrusion showed.
- Review who can write policies and trace requests. Treat policy write on an APIM instance as read access to every named value in it, because it is [4]. Values from Key Vault are also visible to users with access to subscriptions enabled for API request tracing [4]. Remove both from anyone who does not need them, and review subscriptions, users, policies and backends you did not create, as Microsoft's guide advises [3].
For AWS and Google Cloud there is no matching advisory, but the shape of the risk is the same wherever a managed gateway stores credentials for you. AWS states that API Gateway API keys should not be used for authentication or authorization of your APIs [6]. Apigee stores key value maps as encrypted pairs, which, like an APIM Secret, protects the stored copy and not the service that hands it out [7].
How would you notice it?
Two kinds of signal exist, and only one is clearly useful here.
The first is reads of secrets through the control plane. Each secret type in APIM has its own Azure operation under Microsoft.ApiManagement/service, and these appear in the Activity Log, including namedValues/listValue/action, subscriptions/listSecrets/action, tenant/listSecrets/action, identityProviders/listSecrets/action, openidConnectProviders/listSecrets/action, authorizationServers/listSecrets/action, backends/listSecrets/action, gateways/listKeys/action and portalSettings/listSecrets/action [5]. Look for callers you cannot name. The legacy direct management API is a separate endpoint, not the Azure Resource Manager API [9], and the Activity Log records management operations that go through Resource Manager [8], so calls made through it should not be expected there. Neither Microsoft nor NSM has said whether the exploited path left entries, so a clean result proves less than it seems.
The second is use of the secrets after they left, and that does not depend on how they were taken. Check the Entra sign-in logs for the app registrations whose secrets APIM held, looking for sign-ins from addresses outside your gateway and your own systems. Check each backend for calls that did not come through the gateway. If any secret was a Key Vault reference, its audit log shows which identities read it, and anything other than the APIM managed identity deserves a question [4]. Look back as far as your retention allows, because nobody has said when this started [2].
Most of this is not kept by default. Azure retains the Activity Log for 90 days and then deletes it [8]. Gateway and Key Vault logs exist only if a diagnostic setting sends them to a workspace. Entra keeps sign-ins for 7 days on the Free edition and 30 days with P1 or P2, unless you export them [11]. If those were never enabled, the honest answer is that you cannot tell, and rotation is the only safe assumption.
Which services hold copies of your secrets, and for how long, is part of what the audit maps, because a secret copied into a managed service is a finding long before that service has a flaw.
Where this sits in our work
Our audit starts with service accounts, deploy credentials and secrets: where each key lives, how long it lives, and who can read it.
01 AuditKonstantins Feofantovs
Founder of rebuildstack. We audit cloud access and fix what we find, in your infrastructure and in your code.
Sources
- Azure Service Health security advisory MZK9-GH0, sent to affected customers (not public), Microsoft,
- NSM deler tiltak mot sårbarhet i Azure API Management, Nasjonal sikkerhetsmyndighet (NSM),
- Rotating credentials in Azure API Management, Microsoft Tech Community,
- Use named values in Azure API Management policies, Microsoft Learn,
- Azure permissions for Integration, Microsoft Learn,
- Usage plans and API keys for REST APIs in API Gateway, Amazon Web Services,
- Using key value maps, Google Cloud,
- Azure Monitor activity log, Microsoft Learn,
- Direct management API retirement (March 2025), Microsoft Learn,
- Cyber-attack stopped, Equinor,
- Microsoft Entra data retention, Microsoft Learn,