CyberSecurityBoardThreat Intel · CVEs · Products
Critical CVEs

Azure Cosmos DB Flaw Exposed Platform-Wide Key That Could Access Any Database

July 30, 2026

A now-patched vulnerability in Azure Cosmos DB could have allowed an attacker to escape the service’s Gremlin query sandbox and gain full read and write access to databases across customer tenants, according to security firm Wiz. The exploit chain, codenamed CosmosEscape, began with a crafted query against a Gremlin database controlled by the attacker. From there, code execution on a multi-tenant gateway exposed a platform-wide signing secret and a regional account directory, enabling researchers to locate a target and retrieve its primary account key.

Microsoft blocked the vulnerable Gremlin entry point within 48 hours of the November 2025 report and completed the longer-term fix across all regions in July 2026, eliminating the platform-wide key. Microsoft stated that its review found no unauthorized activity outside the researchers’ testing, no customer data was accessed, and no customer action is required.

The exploit chain started with a Gremlin database controlled by the attacker and credentials for that account, not access to a victim database. Wiz’s technical write-up explains that Cosmos DB’s custom Gremlin engine translates Gremlin queries into .NET code and runs them inside a restricted environment. The restrictions failed to account for .NET reflection, allowing researchers to build file-read and file-write primitives before achieving arbitrary code execution. The code execution landed on a component called the DB Gateway, which executes customer queries on multi-tenant Azure Service Fabric clusters. The gateway could retrieve the primary key for any requested Cosmos DB account, and credentials available to the gateway also provided access to a signing key dubbed the Cosmos Master Key. This key could retrieve the primary key for any account across tenants, regions, and APIs (SQL, MongoDB, Cassandra, Gremlin). The same secret opened a regional database called the Config Store, containing account names, subscription and tenant identifiers, network settings, and tags. An attacker could use it to find specific organization accounts and request their primary keys. The chain could also reach private and network-isolated accounts because the compromised gateway enforced those network boundaries from inside the service.

Microsoft documentation indicates that Teams message data remains in Cosmos DB, and Copilot stores users’ queries and conversation histories there. Wiz said databases supporting those products were potentially accessible but did not report accessing their data. The disclosure lists no CVE identifier or severity score. CosmosEscape is technically separate from the ChaosDB and CosMiss flaws disclosed in 2021 and 2022, which involved Cosmos DB’s Jupyter Notebook feature.

CVEs: CVE-2026-50522

Companies: Microsoft, Wiz

Products: Azure Cosmos DB, Azure Service Fabric, Microsoft Teams, Microsoft Copilot

Events: Black Hat USA 2026