ChaosDB: Critical Vulnerability in Microsoft Azure Cosmos DB
A chain of vulnerabilities in the Jupyter Notebook feature of Azure Cosmos DB allowed any Azure user to obtain credentials, including the primary key, for another customer's Cosmos DB account. This gave full admin access (read, write, delete) to the target database without authorization.
Published on chaosdb.wiz.io
#ChaosDB is an unprecedented critical vulnerability in the Azure cloud platform that allows for remote account takeover of Azure’s flagship database - Cosmos DB. The vulnerability, which was disclosed to Microsoft in August 2021 by Wiz Research Team, gives any Azure user full admin access (read, write, delete) to…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
ChaosDB is described in the original as an unprecedented critical vulnerability in the Azure cloud platform that allows remote account takeover of Azure Cosmos DB, Microsoft's flagship database service. The affected feature is the Jupyter Notebook feature of Cosmos DB. The report does not describe in detail what the Jupyter Notebook feature normally does beyond its association with a compute resource and a storage account tied to the Cosmos DB account.
The vulnerability was disclosed to Microsoft in August 2021 by the Wiz Research Team. According to the original, the exploit is trivial, requires no previous access to the target environment, and impacts thousands of organisations, including numerous Fortune 500 companies.
The report states that, by exploiting a chain of vulnerabilities in the Jupyter Notebook feature, a malicious actor can query information about the target Cosmos DB Jupyter Notebook. Doing so yields a set of credentials related to the target Cosmos DB account, the Jupyter Notebook compute, and the Jupyter Notebook Storage account, including the Primary Key. With these credentials it is possible to view, modify and delete data in the target Cosmos DB account via multiple channels.

The diagram above, placed in the original immediately after this description, illustrates the attack.
Setup
The original does not document a setup section: it names no accounts, roles, tools, versions or preconditions beyond the following. The report says the vulnerability gives any Azure user full admin access to another customer's Cosmos DB instances without authorisation. No previous access to the target environment is required. The target must have the Jupyter Notebook feature enabled; the report's Q&A states that any Cosmos DB asset that had Jupyter Notebook enabled is potentially impacted.
The report also notes that the Primary Key for the Cosmos DB could be compromised regardless of network access, but that if the database is not internet facing then the data cannot be accessed remotely. Microsoft's statement adds that Cosmos DB accounts with a vNET or firewall enabled are protected by additional security mechanisms that prevent risk of unauthorised access.
Finding it
The original does not describe the moment of discovery or the reasoning that led the researchers to the Jupyter Notebook feature. It presents the result as a chain of vulnerabilities in that feature, without naming the individual flaws. Per Microsoft's request, the team was not releasing any technical information at the time of this text and said it would publish the full technical paper in the near future. Consequently, this report contains no requests, responses, payloads or commands, and none are reproduced here because the original shows none.
What the original does state is the observable outcome that made the issue significant: querying information about the target Cosmos DB Jupyter Notebook returns credentials for the Cosmos DB account, the notebook compute and the notebook storage account, including the Primary Key. The report says querying information about the target notebook yields credentials including the Primary Key.
Exploitation
The original gives no step-by-step exploitation detail, no HTTP traffic and no code. The only stepwise material is the disclosure timeline, which records the researchers' actions and Microsoft's responses:
- August 09 2021: the Wiz Research Team first exploited the bug and gained unauthorised access to Cosmos DB accounts.
- August 12 2021: the Wiz Research Team sent the advisory to Microsoft.
- August 14 2021: the Wiz Research Team observed that the vulnerable feature had been disabled.
- August 16 2021: MSRC confirmed the reported behaviour (MSRC Case 66805).
- August 16 2021: the Wiz Research Team observed that some obtained credentials had been revoked.
- August 17 2021: MSRC awarded a $40,000 bounty for the report.
- August 23 2021: MSRC confirmed that several thousand customers were impacted.
- August 26 2021: public disclosure.
The report also includes a proof of concept video, placed under the heading POC:
Root cause
The original does not disclose the specific coding or design mistake. It characterises the issue as a chain of vulnerabilities in the Jupyter Notebook feature that allows an attacker to query information about the target's notebook and obtain credentials, including the Primary Key, for the Cosmos DB account, the notebook compute and the notebook storage account. Why existing defences did not stop it is not stated; the report only notes that accounts with a vNET or firewall enabled were protected by additional security mechanisms. Any finer root cause would be speculation and is not supported by the text.
Impact
An attacker who is any Azure user can obtain full admin access (read, write, delete) to another customer's Cosmos DB instances without authorisation, using the obtained Primary Key. The report says this affects thousands of organisations, including numerous Fortune 500 companies, and that all Cosmos APIs are exposed in the same way, including the Azure Cosmos DB API for MongoDB.
The Primary Key could be compromised regardless of network access, but if the database is not internet facing the data cannot be accessed remotely. Microsoft stated it had no indication that external entities outside the researcher had access to the primary read-write key, and that it was not aware of any data access because of the vulnerability. The researchers state they do not know whether the vulnerability was exploited in the wild.
On August 26 2021 Microsoft notified over 30% of Cosmos DB customers about the potential security breach. The researchers believe the actual number of affected customers is higher, because Microsoft notified only customers affected during the roughly one week research period while the vulnerability had been present for months. Their guidance is that every Cosmos DB customer should assume they have been exposed.
Fix
Microsoft's security teams disabled the vulnerable feature within 48 hours of the report; the timeline shows the researchers observing the feature disabled on August 14 2021, two days after the advisory. Some obtained credentials were observed revoked on August 16 2021. Microsoft advised customers to regenerate the Cosmos DB Primary Keys, and the researchers repeat that recommendation for all accounts that had the Jupyter Notebook feature enabled, together with reviewing all past activity in the Cosmos DB account. Microsoft's statement says that once it became aware of the issue on 12 August 2021, it mitigated the vulnerability immediately.
Variants to test
The original provides no payloads, so the following are general directions consistent with what it describes, not reproductions of the researchers' work:
- Enumerate Cosmos DB accounts with the Jupyter Notebook feature enabled and inspect what the notebook provisioning path returns. A positive result is any response that includes credentials for the database account, the notebook compute or the notebook storage account, especially a primary read-write key.
- Test whether notebook-related credentials are scoped to the requesting user or shared across tenants. A positive result is a credential belonging to an account other than the one you created.
- Check the same pattern on other managed notebook or compute features attached to database services, where a control-plane resource may expose data-plane keys. A positive result is a key that grants read, write or delete access to another customer's data.
- Compare behaviour with and without network restrictions (vNET or firewall) to confirm whether key exposure is independent of network access, as the report states for Cosmos DB.
- Test the same exposure across Cosmos APIs, since the report says all Cosmos APIs are exposed in the same way, including the API for MongoDB. A positive result is the same credential disclosure through a different API surface.
Acknowledgements
The report credits Microsoft's security team for disabling the vulnerable entry point within 48 hours of receiving the report. ChaosDB was discovered by Nir Ohfeld (@nirohfeld) and Sagi Tzadik (@sagitz_) of the Wiz Research Team (@wiz_io). The report notes that cloud vulnerabilities do not receive CVE-IDs, which is why a dedicated name and site were created so people can reference the vulnerability.
What happened, in plain words
In August 2021 a group of security researchers at a company called Wiz found a serious flaw in Microsoft's cloud service Azure, specifically in one of its database products called Cosmos DB. The flaw was given the name ChaosDB. The original report calls it an unprecedented critical vulnerability in the Azure cloud platform that allows remote account takeover of Cosmos DB, which it describes as Microsoft's flagship database service.
In everyday terms: a database is an organised store of information, like a very large, very well indexed filing cabinet. Many companies keep customer records, orders, game scores or application data in one. Cosmos DB is Microsoft's product for running such databases in its cloud, meaning on Microsoft's computers rather than on the customer's own machines. "Account takeover" means someone else ends up with the same power over that filing cabinet as its owner: they can open it, read everything, change entries and throw things away.
The report says the flaw gave any Azure user full admin access (read, write, delete) to another customer's Cosmos DB instances without authorisation. "Azure user" here means anyone with an ordinary Microsoft cloud account, not a privileged insider. "Without authorisation" means the owner of the target database never agreed to it and was never asked.
The report also says the exploit is trivial, that it requires no previous access to the target environment, and that it impacts thousands of organisations, including numerous Fortune 500 companies. "Exploit" is the word for the concrete technique used to turn a flaw into an actual break-in. "Trivial" means it was not hard: no special position, no prior foothold inside the victim's network.
The affected feature is the Jupyter Notebook feature of Cosmos DB. A notebook, in this context, is an interactive document that mixes text, code and the output of that code, so people can experiment with data in a browser. The report does not describe in detail what the Jupyter Notebook feature normally does beyond its association with a compute resource and a storage account tied to the Cosmos DB account. "Compute" means a running machine (here, a small server that executes the notebook code), and a "storage account" is a place where files are kept. So the notebook feature brings along its own little computer and its own little file store, both attached to the customer's database account.
By exploiting a chain of vulnerabilities in that feature, the report says, a malicious actor can query information about the target Cosmos DB Jupyter Notebook. "Chain of vulnerabilities" means more than one separate weakness, each making the next one possible, like a series of doors where the key to the second is hanging behind the first. "Query information" means asking the service a question and getting an answer back.
That answer is the heart of the problem. Doing so yields a set of credentials related to the target Cosmos DB account, the Jupyter Notebook compute, and the Jupyter Notebook Storage account, including the Primary Key. "Credentials" are the things that prove identity and grant access: usernames, passwords, keys, tokens. The "Primary Key" is the master key of a Cosmos DB account. Think of a hotel: the Primary Key is not a room key, it is the key that opens every room and also the manager's office. Anyone holding it can act as the owner.
With these credentials it is possible to view, modify and delete data in the target Cosmos DB account via multiple channels. "View, modify and delete" is the full set of powers over data: reading it, changing it, destroying it. "Via multiple channels" means there was more than one route to use those powers, not just one.

The diagram above, placed in the original immediately after this description, illustrates the attack. The report does not label its parts in the text, so the reader should treat it as a picture of the overall flow described in the paragraph: a request towards the notebook feature, credentials coming back, and those credentials then being used against the database.
Setup
The original does not document a setup section: it names no accounts, roles, tools, versions or preconditions beyond the following. This matters for a beginner, because it means there is no list of software to install and no configuration recipe to follow. What the report does say about who and what is needed can be stated plainly.
The report says the vulnerability gives any Azure user full admin access to another customer's Cosmos DB instances without authorisation. In other words, the starting point is an ordinary account on the same cloud platform. You do not need to be an administrator of anything, and you do not need to know the victim.
No previous access to the target environment is required. This is the sentence that makes the flaw severe. Many attacks need a first step, such as a stolen password or a piece of malicious software already running inside a company. Here the report says that first step was not needed.
The target must have the Jupyter Notebook feature enabled; the report's Q&A states that any Cosmos DB asset that had Jupyter Notebook enabled is potentially impacted. "Enabled" means the customer had switched the feature on for that database. The report's Q&A states that any Cosmos DB asset that had Jupyter Notebook enabled is potentially impacted.
The report also notes that the Primary Key for the Cosmos DB could be compromised regardless of network access, but that if the database is not internet facing then the data cannot be accessed remotely. Two ideas are packed into that sentence. "Network access" is about which machines are allowed to talk to the database over a network. "Internet facing" means reachable from the public internet. So the key could leak even for a database that outsiders cannot reach, but without reachability the stolen key is much less useful to a remote attacker, because there is no path to use it from outside.
Microsoft's statement adds that Cosmos DB accounts with a vNET or firewall enabled are protected by additional security mechanisms that prevent risk of unauthorised access. A "firewall" is a filter that allows or blocks network traffic according to rules. A "vNET" is a virtual network: a private, software-defined network inside the cloud, so that resources talk to each other without being exposed to the open internet. Both are ways of restricting who can reach the database over the network.
Finding it
The original does not describe the moment of discovery or the reasoning that led the researchers to the Jupyter Notebook feature. For a beginner this is worth stating clearly: there is no story here of a hunch, a screenshot or a particular test that pointed them at notebooks. The report presents the result as a chain of vulnerabilities in that feature, without naming the individual flaws.
Per Microsoft's request, the team was not releasing any technical information at the time of this text and said it would publish the full technical paper in the near future. This is a normal arrangement in security research: the vendor asks for time to fix things before details become public, so that other people cannot copy the attack. Consequently, this report contains no requests, responses, payloads or commands, and none are reproduced here because the original shows none. A "payload" is the specific piece of data or code sent to trigger a flaw. A "request" is the message a browser or program sends to a server asking it to do something, and a "response" is the server's reply.
What the original does state is the observable outcome that made the issue significant: querying information about the target Cosmos DB Jupyter Notebook returns credentials for the Cosmos DB account, the notebook compute and the notebook storage account, including the Primary Key. The report says querying information about the target notebook yields credentials including the Primary Key. An "endpoint" is a specific address on a server that accepts a particular kind of request, like a particular counter in a large office. "Primary read-write key" is the same master key described earlier, named for the fact that it permits both reading and writing.
To put the wrongness in everyday terms: it is as if the key to the stationery cupboard also opened the bank vault, and the cupboard was the easier door to reach.
Exploitation
The original gives no step-by-step exploitation detail, no HTTP traffic and no code. "HTTP" is the language browsers and servers use to exchange requests and responses; "HTTP traffic" would mean captured examples of those messages. There are none in the original, so none appear here.
The only stepwise material is the disclosure timeline, which records the researchers' actions and Microsoft's responses. A "disclosure timeline" is a dated list of who did what and when, from the first test to the public announcement. It is useful because it shows how quickly each side moved.
- August 09 2021: the Wiz Research Team first exploited the bug and gained unauthorised access to Cosmos DB accounts. This is the proof: they did not merely suspect the flaw, they used it and reached accounts that were not theirs.
- August 12 2021: the Wiz Research Team sent the advisory to Microsoft. An "advisory" is a private report to the vendor describing a security problem so it can be fixed.
- August 14 2021: the Wiz Research Team observed that the vulnerable feature had been disabled. "Disabled" means switched off at the service level, so the entry point no longer worked for anyone.
- August 16 2021: MSRC confirmed the reported behaviour (MSRC Case 66805). MSRC is Microsoft's Security Response Center, the team that handles reported vulnerabilities. A "case number" is simply the ticket identifier for the report.
- August 16 2021: the Wiz Research Team observed that some obtained credentials had been revoked. "Revoked" means cancelled: a key or password that used to work no longer does.
- August 17 2021: MSRC awarded a $40,000 bounty for the report. A "bug bounty" is a programme where a company pays researchers for reporting flaws responsibly.
- August 23 2021: MSRC confirmed that several thousand customers were impacted. "Impacted" here means potentially exposed to the flaw.
- August 26 2021: public disclosure. "Public disclosure" is the moment the details become available to everyone, in this case through the report and site.
The report also includes a proof of concept video, placed under the heading POC:
A "proof of concept", or POC, is a demonstration that the flaw is real, usually by performing the attack in a controlled setting.
Root cause
The original does not disclose the specific coding or design mistake. "Root cause" means the underlying reason the flaw exists, as opposed to its symptoms. For a beginner, the honest answer here is that the public text stops at the description of what the feature returned, not why it was built that way.
It characterises the issue as a chain of vulnerabilities in the Jupyter Notebook feature that allows an attacker to query information about the target's notebook and obtain credentials, including the Primary Key, for the Cosmos DB account, the notebook compute and the notebook storage account. The report describes a chain of vulnerabilities in the Jupyter Notebook feature that yields credentials including the Primary Key.
Why existing defences did not stop it is not stated; the report only notes that accounts with a vNET or firewall enabled were protected by additional security mechanisms. In plain terms: the network filter could stop someone reaching the database from outside, but it could not stop the key from leaking in the first place. Any finer root cause would be speculation and is not supported by the text.
Impact
An attacker who is any Azure user can obtain full admin access (read, write, delete) to another customer's Cosmos DB instances without authorisation, using the obtained Primary Key. "Full admin access" means the highest level of control over the data. "Instances" means the individual databases a customer runs.
The report says this affects thousands of organisations, including numerous Fortune 500 companies, and that all Cosmos APIs are exposed in the same way, including the Azure Cosmos DB API for MongoDB. An "API" is the set of addresses and rules a program uses to talk to a service, like a menu of things you are allowed to ask for and the format of the answers. Cosmos DB offers several APIs so that applications written for different database styles can use it; MongoDB is one such style. The report's point is that changing the API did not change the exposure.
The Primary Key could be compromised regardless of network access, but if the database is not internet facing the data cannot be accessed remotely. This is the same distinction as before: leaking the key and using the key are two separate things, and the second needs a route to the database.
Microsoft stated it had no indication that external entities outside the researcher had access to the primary read-write key, and that it was not aware of any data access because of the vulnerability. The researchers state they do not know whether the vulnerability was exploited in the wild. "In the wild" means by real attackers against real victims, as opposed to in a test.
On August 26 2021 Microsoft notified over 30% of Cosmos DB customers about the potential security breach. The researchers believe the actual number of affected customers is higher, because Microsoft notified only customers affected during the roughly one week research period while the vulnerability had been present for months. Their guidance is that every Cosmos DB customer should assume they have been exposed. The reasoning is simple: if the flaw existed for months, then the week in which the researchers happened to test is not the only week in which someone else could have found it.
Fix
Microsoft's security teams disabled the vulnerable feature within 48 hours of the report; the timeline shows the researchers observing the feature disabled on August 14 2021, two days after the advisory. "Mitigation" is the general word for reducing or removing risk, and here the first mitigation was to switch the feature off.
Some obtained credentials were observed revoked on August 16 2021. Revoking credentials matters because a key that has already leaked may have been copied; cancelling it makes the copy useless.
Microsoft advised customers to regenerate the Cosmos DB Primary Keys, and the researchers repeat that recommendation for all accounts that had the Jupyter Notebook feature enabled, together with reviewing all past activity in the Cosmos DB account. "Regenerate" means create a new key to replace the old one, so the old value no longer opens anything. "Reviewing past activity" means reading the logs, the recorded history of who did what, to look for anything unexpected.
Microsoft's statement says that once it became aware of the issue on 12 August 2021, it mitigated the vulnerability immediately. The report also quotes Microsoft's statement that accounts with a vNET or firewall enabled are protected by additional security mechanisms, and that Microsoft had no indication of access by outside parties or of any data access.
Variants to test
The original provides no payloads, so the following are general directions consistent with what it describes, not reproductions of the researchers' work. They are written for someone learning how researchers think about a flaw once it is known, not as instructions to attack anyone. Testing must only ever be done on systems you own or have explicit permission to test.
- Enumerate Cosmos DB accounts with the Jupyter Notebook feature enabled and inspect what the notebook provisioning path returns. "Enumerate" means list out. "Provisioning" is the process of setting a resource up. A positive result is any response that includes credentials for the database account, the notebook compute or the notebook storage account, especially a primary read-write key. The idea is to look at what a setup step hands back, because setup steps often carry secrets.
- Test whether notebook-related credentials are scoped to the requesting user or shared across tenants. "Scoped" means limited to a particular owner or purpose. A "tenant" is one customer's separate space in a shared cloud service. A positive result is a credential belonging to an account other than the one you created, which would show the boundary between customers is not being enforced.
- Check the same pattern on other managed notebook or compute features attached to database services, where a control-plane resource may expose data-plane keys. "Control plane" means the part of a cloud that manages resources (creating, configuring, deleting them); "data plane" means the part that handles the actual data. A positive result is a key that grants read, write or delete access to another customer's data. The pattern to look for is a management feature that leaks the keys to the data it manages.
- Compare behaviour with and without network restrictions (vNET or firewall) to confirm whether key exposure is independent of network access, as the report states for Cosmos DB. This separates two questions: can the key leak, and can the key be used from outside. The report says the first can happen regardless of the second.
- Test the same exposure across Cosmos APIs, since the report says all Cosmos APIs are exposed in the same way, including the API for MongoDB. A positive result is the same credential disclosure through a different API surface. "Surface" means the set of entry points a service offers.
Acknowledgements
The report credits Microsoft's security team for disabling the vulnerable entry point within 48 hours of receiving the report. ChaosDB was discovered by Nir Ohfeld (@nirohfeld) and Sagi Tzadik (@sagitz_) of the Wiz Research Team (@wiz_io). The report notes that cloud vulnerabilities do not receive CVE-IDs, which is why a dedicated name and site were created so people can reference the vulnerability. A "CVE-ID" is a standard identifier assigned to publicly catalogued vulnerabilities; the report's point is that flaws in cloud services often fall outside that system, so a name like ChaosDB fills the gap.
Glossary
- Account takeover: gaining the same control over someone else's account as its owner, here over a Cosmos DB account.
- Advisory: a private report sent to a vendor describing a security problem so it can be fixed.
- API: the defined set of addresses and rules a program uses to talk to a service, like a menu of allowed requests and the format of replies.
- Azure: Microsoft's cloud platform, where customers rent computing and storage.
- Bug bounty: a programme that pays researchers for responsibly reporting security flaws.
- Chain of vulnerabilities: two or more separate weaknesses where each makes the next possible.
- Compute: a running machine in the cloud that executes code, here the machine behind the notebook.
- Control plane: the part of a cloud that creates and configures resources, as opposed to handling their data.
- Cosmos DB: Microsoft's flagship cloud database service.
- Credentials: the values that prove identity and grant access, such as keys, passwords and tokens.
- CVE-ID: a standard identifier for publicly catalogued vulnerabilities; the report notes cloud vulnerabilities do not receive one.
- Data plane: the part of a service that handles the actual data, as opposed to managing resources.
- Disabled: switched off at the service level so the feature no longer works for anyone.
- Disclosure timeline: a dated list of actions and responses from first test to public announcement.
- Endpoint: a specific address on a server that accepts a particular kind of request.
- Enumerate: to list out items, such as accounts or features.
- Exploit: the concrete technique that turns a flaw into an actual break-in.
- Firewall: a filter that allows or blocks network traffic according to rules.
- Full admin access: the highest level of control over data, here read, write and delete.
- HTTP: the language browsers and servers use to exchange requests and responses.
- Impacted: potentially exposed to the flaw.
- In the wild: happening in real attacks against real victims, not in a test.
- Internet facing: reachable from the public internet.
- Jupyter Notebook: an interactive document mixing text, code and output, run in a browser; here a Cosmos DB feature with its own compute and storage.
- Mitigation: any action that reduces or removes risk.
- MSRC: Microsoft Security Response Center, the team that handles reported vulnerabilities.
- Payload: the specific piece of data or code sent to trigger a flaw.
- POC (proof of concept): a demonstration that a flaw is real, usually performed in a controlled setting.
- Primary Key: the master key of a Cosmos DB account, granting read and write access to its data.
- Provisioning: the process of setting a cloud resource up.
- Query: to ask a service a question and receive an answer.
- Regenerate: to create a new key replacing an old one, so the old value stops working.
- Request: the message a browser or program sends to a server asking it to do something.
- Response: the server's reply to a request.
- Revoked: cancelled, so a key or password that used to work no longer does.
- Root cause: the underlying reason a flaw exists, as opposed to its symptoms.
- Scoped: limited to a particular owner, purpose or boundary.
- Storage account: a place in the cloud where files are kept.
- Surface: the set of entry points a service offers.
- Tenant: one customer's separate space in a shared cloud service.
- Trivial: easy to carry out, needing no special position or prior foothold.
- vNET: a virtual network, a private software-defined network inside a cloud.
- Vulnerability: a weakness in software or design that can be used to break security.