CosmosEscape flaw threatens the Azure Cosmos DB platform
- Kamy Le

- 10 hours ago
- 3 min read
Wiz Research has recently disclosed details about CosmosEscape flaw – a critical security vulnerability in Microsoft's Azure Cosmos DB database service. The flaw allows attackers to bypass authorization barriers, conduct cross-tenant interactions between user accounts, and threaten data security on a global scale.

The nature and scope of impact of CosmosEscape flaw
CosmosEscape is the name given by researchers at Wiz Research to a critical security vulnerability discovered in Azure Cosmos DB, Microsoft's flagship NoSQL database service. The flaw resides in the system's Gremlin API programming interface.
If successfully exploited, the vulnerability could allow an attacker to take control of any database on the platform. The list of affected targets includes key internal Microsoft services such as Microsoft Entra ID, Microsoft Teams, and Microsoft Copilot.
Details of the 4-step system exploitation chain
To demonstrate the compromise capability, researchers constructed a complete 4-step attack chain:
Sandbox Escape: When running Gremlin graph queries, the research team discovered an unusual .NET exception. This revealed that the system uses a custom .NET query compiler. Because the test environment did not restrict .NET reflection techniques, an attacker could read/write files and perform Remote Code Execution (RCE) on the DB Gateway—a shared component used to process queries from multiple customers.
Credential Harvesting: At the DB Gateway, researchers extracted credentials for an unscoped signing key.
Target Discovery: The signing key opened access to the Config Store—a regional catalog containing information on all Cosmos DB accounts, subscription IDs, tenant IDs, and network configurations. Querying this data was easily accomplished using standard SQL syntax.
Cross-Tenant Access: The attacker uses the signing key to obtain the primary key of any account, thereby gaining full read and write permissions to all data across all regions and API interfaces.
The table below summarizes the detailed stages in the vulnerability exploitation lifecycle:
Attack Phase | Exploitation Mechanism & Technique | Technical Operational Impact |
Sandbox Escape | Unrestricted .NET reflection in the Gremlin engine | RCE on multi-tenant DB Gateway |
Credential Harvesting | Extraction of unscoped DB Gateway signing key | Access to global Cosmos Master Key |
Target Discovery | Querying regional Config Store directories | Enumeration of subscription IDs, tenant IDs, and network settings |
Cross-Tenant Access | Generating primary keys via DB Gateway | Compromise of all read/write data across all regions and APIs |
The exceptional severity of the flaw
What makes CosmosEscape particularly dangerous is the existence of a global signing key, also known as the "Cosmos Master Key". This key is not restricted to an individual tenant, but is valid across all accounts, geographic regions, and various API interfaces such as SQL, MongoDB, Cassandra, or Gremlin.
In addition, the vulnerability also affects Cosmos DB systems isolated within private networks. Since the compromised DB Gateway is the component responsible for enforcing network isolation rules, having write access to the Config Store means an attacker could completely alter these isolation settings. Detecting the vulnerability through automated processes was also exceptionally difficult due to the query compilation mechanism utilizing custom reflection techniques.

How Microsoft handled CosmosEscape
Wiz Research reported the vulnerability to Microsoft on November 20, 2025. Within 48 hours, Microsoft released an emergency hotfix. Over the following months, the company migrated to a new security architecture, completely eliminating the design model that relied on the Cosmos Master Key.
The upgrade process was completed in July 2026, and the information was publicly disclosed on July 30, 2026. Technical details of the incident will be presented at the Black Hat USA event in the talk titled “One Key to Rule Them All: Taking Over a Flagship Cloud Service”.
Microsoft confirmed through internal log reviews that there was no evidence of the vulnerability being exploited outside of Wiz's legitimate testing activities, no customer data was accessed without authorization, and no further action is required from users.
Valuable lessons in Cloud-Native Security
The CosmosEscape incident provides a crucial lesson for cloud infrastructure: shared infrastructure services must establish extremely strict isolation boundaries for user-controlled execution environments. When a credential or signing key has a multi-tenant scope, a minor loophole in the isolation environment can lead to a complete takeover of the platform.
The timely detection and remediation of CosmosEscape helped prevent a large-scale security risk to Microsoft's cloud infrastructure. This incident once again underscores the importance of proactively auditing vulnerabilities and tightening authorization mechanisms in modern cloud computing environments.
Reference: Cyber Press










Comments