Attackers exploited an Azure API Management flaw to steal secrets, Microsoft warns

Wait 5 sec.

Microsoft is warning customers that attackers exploited a flaw in Azure API Management Classic tiers to steal stored secrets, an intrusion that Norway’s National Security Authority has linked to breaches at two energy companies and says organizations should assume exposed credentials were compromised. Microsoft said in an Azure Service Health security advisory sent to customers that it identified the vulnerability on Nov. 18 and deployed a mitigation the following day. The advisory, tracking ID MZK9-GH0, said the exposure began before Microsoft found the flaw, reported Bleeping Computer.The company said in the advisory that “an unauthorized party could have used the issue to access secrets stored in Azure API Management Classic instances.”The potentially exposed information includes secrets stored in Named Values, client secrets associated with identity providers and OpenID Connect providers, subscription keys, and tokens used to call direct management APIs, the report added.Microsoft warned that its mitigation does not invalidate previously compromised credentials and that affected customers must rotate potentially exposed secrets and investigate suspicious activity. The advisory said only the Classic tiers of the service are affected, not Azure API Management v2, the report added.The potential exposure was not limited to a theoretical security risk. Norway’s National Security Authority (NSM) subsequently linked cyberattacks against two energy companies to the vulnerability, providing evidence of exploitation in an operational environment.Norway tells customers to assume exposureIn a security advisory published November 20 and updated November 23, NSM said an unidentified actor had actively targeted access tokens, secrets, and Named Values stored in Azure API Management.“Earlier this week, NSM became aware of a vulnerability in Azure API Management (APIM) that affects several Norwegian businesses,” NSM said in the advisory, translated from Norwegian.It said the vulnerability should now be closed, but asked organizations to take measures anyway.“Anyone with Azure API Manager must assume that their secrets and named values ​​are out of whack,” the advisory added. “This means that the business must roll back all tokens and secrets.”In the advisory, NSM’s director of operational cybersecurity, Martin Albert-Hoff, said the vulnerability was first discovered by Norway’s energy sector.  The agency identified Equinor and Skagerak Energi among the affected organizations and said the vulnerability had also affected organizations in other countries and sectors.Equinor disclosed a cyberattack against some of its IT systems on November 17. In an update published November 20, the company said the attack had been stopped, production was running normally, and there was no indication that data had been stolen or altered.A day later, Skagerak Energi reported an attempted cyberattack against some of its IT systems. The company said the incident had not affected its operations or production and that there was no indication that information had been compromised.NSM warned that public disclosure of the vulnerability could encourage additional threat actors to attempt exploitation.“When a vulnerability becomes known, multiple actors may attempt to exploit it,” the agency said in its advisory (translated from Norwegian), adding that the rapid escalation in the use of artificial intelligence was affecting the threat environment.Neither Microsoft’s advisory nor NSM’s notice includes a CVE identifier for the flaw.Urgent need to rotate credentialsMicrosoft’s mitigation closed the unauthorized management-plane access path, but it advised customers to investigate whether their APIM instances were accessed before the fix and whether stored credentials could have been exposed, the report added.In a November 21 post on its Azure Integration Services blog, Microsoft published guidance on identifying and rotating credentials configured in Azure API Management.The guidance covers subscription keys, Named Values containing secrets, backend credentials, OAuth 2.0 and OpenID Connect client secrets, connection strings, and credentials written directly into API policies.Microsoft recommended that organizations rotate credentials at the systems where they were originally issued, rather than simply updating their values in APIM.“Updating the value in API Management alone does not invalidate the old credential,” the company said in the blog post, as per the report.NSM has issued more extensive recommendations, advising organizations using Azure API Management to assume that their secrets and Named Values may have been exposed and to rotate all associated tokens and secrets.The agency also published a patch check. According to NSM, instances on the 0.52.x branch are patched from build 31936, and those on 0.53.x are from build 31938. V2 and Consumption tier instances are not vulnerable, the agency said.Organizations with unpatched instances should contact Microsoft directly, and those that see signs of compromise should contact NSM, the advisory said.Cloud security researcher Anders Kristiansen, who published detection and hunting guidance after the advisories, said patching alone is not enough.“If you run APIM, patching isn’t the end of it,” Kristiansen wrote in a blog post.His rotation list includes backend credentials, app registration secrets, subscription keys, the Key Vault secrets the service references, and tenant access keys. Microsoft did not immediately respond to CSO’s request for comment.