CosmosEscape: Azure Cosmos DB flaw exposed a platform key that could open any account
Wiz Research disclosed on 30 July 2026 a vulnerability chain in Azure Cosmos DB's Gremlin API that it named CosmosEscape. Wiz said the restrictions Cosmos DB's engine applied to Gremlin queries did not sufficiently account for .NET reflection, allowing code execution on the multi-tenant DB Gateway, where a signing key it dubbed the 'Cosmos Master Key' could retrieve the primary key of any Cosmos DB account across tenants, regions and API types. Microsoft deployed a mitigation within 48 hours of the 20 November 2025 report and completed a long-term fix across all regions in July 2026. Microsoft said extensive reviews of access logs found no evidence of unauthorised activity outside the researchers' testing and that no customer action is required.
- Azure
- Cosmos DB
- tenant isolation
- cloud control plane
- Wiz
- Gremlin API
- managed identities
What the sources report
- Wiz's disclosure timeline: reported 20 November 2025; Microsoft hot fix 22 November 2025; long-term fix rolled out across all regions in July 2026; public disclosure 30 July 2026.
- Wiz said the key also opened the regional Config Store, which held account names, subscription IDs, tenant IDs, network settings and tags, enabling an attacker to list all accounts in a region or query by tenant ID to find a specific organisation's databases.
- Wiz said private and network-isolated accounts were affected because the DB Gateway is responsible for enforcing network isolation, and that the databases of Microsoft Entra ID, Teams and Copilot, which store data in Cosmos DB, were potentially accessible.
- Wiz told The Hacker News the only prerequisite was a standard Azure account with an attacker-controlled Cosmos DB Gremlin database; the disclosure lists no CVE identifier or severity score.
- According to Wiz, Microsoft eliminated the Cosmos Master Key and introduced new guardrails to Cosmos DB to prevent similar attacks.
- CSO Online reported an IDC analyst's view that Gremlin API users should review available logs and that organisations should reduce reliance on static database account keys through managed identities, fine-grained role-based access control and client-side encryption where practical.
What it means for your organisation
CosmosEscape shows tenant isolation failing beneath the layer customers configure: Wiz said the DB Gateway it compromised was the component responsible for enforcing customers' network isolation. Customers had nothing to patch, but they do decide how much a single database key can open, since a primary key grants full read-write access while identity-based access and client-side encryption limit what any one secret exposes. The Hacker News notes it is technically separate from the ChaosDB and CosMiss Cosmos DB flaws disclosed in 2021 and 2022, which is a reason for cloud threat models to plan for provider-side failure rather than treat it as an edge case.
What we check
- Check whether Cosmos DB and other managed databases still accept account-key authentication, and whether key-based access can be disabled in favour of Entra ID role-based access and managed identities.
- Locate every stored account key and connection string (app settings, pipelines, developer machines) and confirm rotation is scheduled and tested.
- Identify the most sensitive fields and assess client-side or application-level encryption so a storage-layer key alone does not yield plaintext.
- Confirm data-plane diagnostic logs are enabled and retained long enough to check provider advisories against your own records.
- Check whether cloud threat models and incident response plans cover a provider-side isolation failure, including how to obtain assurance from the provider when regulators ask.
Sources
- CosmosEscape: Taking Over Every Database in Azure Cosmos DB (opens in a new tab) · Wiz · 30 July 2026
- Critical Azure Cosmos DB flaw threatened cross-tenant database takeover (opens in a new tab) · CSO Online · 4 August 2026
- Azure Cosmos DB Flaw Exposed Platform-Wide Key That Could Access Any Database (opens in a new tab) · The Hacker News · 30 July 2026