Researchers at Wiz, now part of Google, found a now-patched chain in Azure Cosmos DB that could have let an attacker escape the service’s Gremlin query sandbox and obtain a platform-wide master key. Wiz codenamed the chain CosmosEscape and said it would have granted read and write access to any Cosmos DB account, plus a directory of every database on the service with subscription and tenant identifiers.
The chain began with a crafted query against a Gremlin database controlled by the attacker. From there, the researchers achieved code execution on backend nodes and escalated to the Cosmos Master Key, which Microsoft has since removed from the infrastructure.
Wiz reported the flaw to Microsoft in November 2025. Microsoft deployed a hotfix within two days, then spent about eight months re-engineering the service to delete the master key and add guardrails that block similar attacks. There is no evidence the chain was exploited before the fix.
Azure Cosmos DB is the NoSQL database that underpins Microsoft’s cloud services, accessed through SDKs for Python, Node.js, Java, and .NET. The finding echoes 2021, when Wiz exposed a Jupyter Notebook flaw in Cosmos DB that also put primary keys at risk.

