AIO APEX

Researchers Disclose 'CosmosEscape' Flaw That Could Have Exposed Every Azure Cosmos DB Database

Wiz Research
Share:
Researchers Disclose 'CosmosEscape' Flaw That Could Have Exposed Every Azure Cosmos DB Database

Security researchers at Wiz have publicly disclosed CosmosEscape, a vulnerability chain in Microsoft's Azure Cosmos DB that could have allowed an attacker to extract a platform-wide master key and use it to retrieve the primary access key of any customer's Cosmos DB database — including databases protected by network isolation controls. Microsoft fixed the underlying issue months before the public write-up, and the company says it found no evidence the flaw was ever exploited outside Wiz's own testing.

Wiz reported the vulnerability to Microsoft on November 20, 2025. Microsoft deployed an immediate hotfix within two days to block the specific attack vector, then spent the following months building and rolling out a longer-term architectural fix across all regions, which completed in July 2026. The public disclosure followed on July 30.

The vulnerability originated in Cosmos DB's Gremlin API, which translates graph database queries into executable .NET code behind the scenes. Wiz's researchers found that the query engine's sandboxing did not adequately restrict .NET reflection techniques, letting them build primitives for arbitrary file read, file write, and code execution against the multi-tenant gateway that processes Gremlin queries for every Cosmos DB customer on the platform.

From that foothold, the researchers located and extracted the Cosmos Master Key — a single platform-wide signing credential stored on the shared Service Fabric infrastructure underlying the service. With that key, an attacker could query Cosmos DB's internal configuration store to enumerate every account on the platform by region, then retrieve the primary access key for any specific account they chose to target, granting full read and write access to that customer's data.

What made the flaw particularly severe is that it bypassed the protection customers would normally expect from network isolation. Cosmos DB's gateway is the component responsible for enforcing network access restrictions in the first place, so compromising the gateway itself meant an attacker could potentially reconfigure those restrictions rather than simply working around them — meaning even privately networked, non-public-facing Cosmos DB deployments were theoretically exposed.

The scope extends beyond directly provisioned customer databases. Azure Cosmos DB underpins several of Microsoft's own core services, including Microsoft Entra ID, Microsoft Teams, and Microsoft Copilot, all of which rely on Cosmos DB as backend infrastructure — meaning a successful exploit chain could theoretically have reached well beyond a single customer's data.

Microsoft has confirmed the vulnerability is fully remediated, telling researchers it identified no evidence of unauthorized access beyond Wiz's controlled testing and that no customer data was compromised. The company has since hardened the authentication architecture around the master key and added additional network protections at the gateway layer. Cosmos DB customers do not need to take any action — the fix was applied platform-wide before this disclosure, and there is nothing for individual account holders to patch or reconfigure on their end.

Originally reported by Wiz Research. Read the original article for additional details.

View original source
Share: