Skip to content
Tech News
← Back to articles

CosmosEscape: Taking over Every Database in Azure Cosmos DB

read original more articles
Why This Matters

The CosmosEscape vulnerability highlights the critical importance of securing cloud database services, as a single flaw could have compromised Microsoft's internal and customer data across Azure Cosmos DB. Its remediation underscores the need for continuous security enhancements in cloud infrastructure to protect sensitive information and maintain trust. This incident serves as a reminder for the industry to prioritize proactive security measures in database management and cloud services.

Key Takeaways

Wiz Research uncovered CosmosEscape, a critical vulnerability in Azure’s flagship database service, Azure Cosmos DB, via its Gremlin API. The vulnerability could have been exploited to compromise every database in the service, including Microsoft's own internal databases - potentially enabling a cross-service attack.

Through CosmosEscape, attackers could have acquired what we’ve dubbed the Cosmos Master Key - a platform-wide secret that granted two incredibly powerful capabilities:

Takeover - retrieving the primary key of any Cosmos DB account on demand, resulting in full read & write access. Enumeration - listing all databases on the service with the ability to filter by specific organization identifiers like subscription and tenant IDs.

Chained together, these capabilities could have enabled precision targeting at platform scale: from identifying a specific organization's databases to compromising them, all from publicly accessible endpoints.

Cosmos DB is used internally across Microsoft - services like Microsoft Entra ID, Microsoft Teams, and Microsoft Copilot all store data in Cosmos DB. Their databases were potentially accessible via this vulnerability.

Microsoft has now fully remediated the issue, including eliminating the Cosmos Master Key. Microsoft also introduced new guardrails to Cosmos DB to prevent similar attacks.

Figure 1: CosmosEscape’s impact

This research was assisted by an early version of Atlas, our AI vulnerability researcher. Expect more from Atlas soon.

Required Actions

Microsoft has fully remediated this issue. No customer action is required. Microsoft conducted a thorough investigation and found no evidence of exploitation of this vulnerability beyond the research described in this blog.

... continue reading