This precis outlines the "CosmosEscape" vulnerability discovered by Wiz researchers in Azure Cosmos DB.
### **What Happened**
Researchers discovered a severe vulnerability in the Azure Cosmos DB Gremlin API that allowed for an "escape" from the database's restricted environment. By exploiting this flaw, attackers could achieve arbitrary code execution on the backend infrastructure, ultimately leading to the discovery of a "Cosmos Master Key" that granted unauthorized, full read/write access to any Cosmos DB account across the entire platform 【1】.
### **Who Is Affected**
The vulnerability was platform-wide, potentially impacting every Cosmos DB account—including those owned by Microsoft itself (e.g., Microsoft Entra ID, Teams, and Copilot) and those configured for private/network-isolated environments 【1】. However, Microsoft's investigation found no evidence of exploitation beyond the researchers' activity, and no customer data was compromised 【1】.
### **Technical Details**
* **Initial Entry:** The vulnerability originated in the Gremlin API, which translated user queries into .NET code. The security restrictions meant to sandbox these queries failed to account for .NET reflection, allowing for file operations and, eventually, arbitrary code execution 【1】.
* **Cosmos Master Key:** Once inside the backend, attackers could access a signing key that was not scoped to a single account but functioned globally across all tenants, regions, and API types (SQL, MongoDB, Cassandra, and Gremlin) 【1】.
* **Config Store Access:** The master key also provided access to the "Config Store," a regional registry containing metadata for every Cosmos DB account. This enabled attackers to enumerate all databases in a region or target specific organizations by subscription or tenant ID 【1】.
* **Bypassing Isolation:** Because the compromised gateway was responsible for network enforcement, the exploit could bypass private network isolation and potentially even modify network settings by writing to the Config Store 【1】.
### **Security Implications**
* **Full Data Access:** Attackers could perform complete takeovers of any database, resulting in unrestricted read/write permissions 【1】.
* **Platform-Wide Risk:** The lack of scoping meant the vulnerability was not limited to individual instances; it undermined the security of the entire service infrastructure.
### **What Defenders Should Know**
* **Mitigation:** Microsoft addressed the vulnerability within 48 hours of the report by deploying a mitigation to the Gremlin API that blocked the entry point 【1】.
* **Customer Action:** No customer action is required, as the issue was resolved entirely on the provider side 【1】.