ChaosDB: Infosec bods could pull anyone's plaintext Azure Cosmos DB keys at will from Microsoft admin tools

And they had a wildcard cert too. Still feeling secure?


Black Hat Europe An astonishing piece of vulnerability probing gave infosec researchers a way into to Microsoft's management controls for Azure Cosmos DB – with full read and write privileges over customer databases.

The so-called ChaosDB vuln gave Wiz researchers "access to the control panel of the underlying service" that hosts Azure Cosmos, Microsoft's managed cloudy document database service, they said.

Wiz was able to obtain plaintext Primary Keys "for any Cosmos DB instance running in our cluster" as well as executing arbitrary code in any other customer's Jupyter Notebook instances.

Worse than that, the researcher claimed: "Using just one certificate, we managed to authenticate to internal Service Fabric instances of multiple [Azure Cosmos] regions that were accessible from the internet." Service Fabric, as Reg readers may know, is Microsoft's home-grown microservice platform and one of the core services in Azure.

Full details of the vuln chain and pwnage, which The Register first reported in August, were made public at Black Hat Europe this week.

C# running as root

Thanks to a series of exploitable configuration blunders, the Wiz researchers were able to escape from their own containerised Azure Cosmos instance onto the underlying virtual machine, and then freely roam around Azure Service Fabric – Microsoft's own Kubernetes-style service that controls Azure Cosmos.

"We were, just, like, looking for misconfigurations," one of the Wiz team, researcher Nir Ohfeld, said during in an interview with The Register today. His fellow researcher Sagi Tzadik added: "Between us, we refer it to like escaping the Matrix. We went from being managed by the service to managing the service."

The two described their company's as a Holy Grail for attackers, and said the level of access they secured should have Azure customers asking Microsoft some sharp questions.

Wiz's eye-popping blogpost details what the company found: a chain of vulnerabilities that ultimately granted them access to other users' databases within Azure Cosmos, thanks to private keys issued by Microsoft.

The researchers started off by looking closely at Jupyter Notebook within Azure Cosmos. The open-source web app lets developers create and share live code with others, and as part of that needs to support various languages.

Wiz spotted something quite surprising: C# code was executed as root: "For some unknown reason, the host process for C# specifically was running with root privileges, which meant that any C# code would be executed as root as well. We used this misconfiguration to escalate our privileges inside the container."

From there they decided to see what was keeping them inside the container. The answer, unbelievably, was a set of firewall rules inside the container, viewable with iptables. Using their root privs in C# they deleted those rules. And that was all it took.

Using the IP addresses defined in the deleted firewall rules, Ohfeld and Tzadik say their team "conducted some network recon" on IP addresses specified in those rules, using the unimprovable logic:

...that if the developers went through the trouble of explicitly attempting to prevent us from accessing these addresses, then we should most definitely go through the trouble of attempting to access them.

"The output gave us a list of all Cosmos DB instances (more than 500!) that were managed by this regional cluster, including those that do not belong to our account," says Wiz.

This got them onto the Windows-based host VM. From there they pivoted to WireServer, an extension (as in software app) manager used to administer Azure VMs. Helpfully, WireServer is an open-source project on GitHub; poking around there gave enough clues to identify some Azure Cosmos certificates in WireServer – and their private keys.

Those included a wildcard cert for notebook.cosmos.azure.com which could have, as Wiz puts it, "allowed us to intercept encrypted SSL traffic of customers’ Jupyter Notebook running on the HOST Windows VM."

Ohfeld described this to El Reg as "the Holy Grail for an attacker." Tzadik added that a malicious person with those keys could have even encrypted every single customer database within reach – potentially thousands, with a bit more lateral movement through the Azure Cosmos management layer.

Matt Yonkovit, head of open source strategy at database firm Percona, told The Register: "The report is quite an interesting read of how the attackers were able to use public information and open source to gain additional insight into the environment they were exploring. I also found it surprising that the host OS used for these Linux containers was a Windows operating system, so they were running on the Windows Subsystem for Linux (WSL)."

We have asked Microsoft for comment and will update this article if we hear back from the company. ®

Similar topics


Other stories you might like

  • Prisons transcribe private phone calls with inmates using speech-to-text AI

    Plus: A drug designed by machine learning algorithms to treat liver disease reaches human clinical trials and more

    In brief Prisons around the US are installing AI speech-to-text models to automatically transcribe conversations with inmates during their phone calls.

    A series of contracts and emails from eight different states revealed how Verus, an AI application developed by LEO Technologies and based on a speech-to-text system offered by Amazon, was used to eavesdrop on prisoners’ phone calls.

    In a sales pitch, LEO’s CEO James Sexton told officials working for a jail in Cook County, Illinois, that one of its customers in Calhoun County, Alabama, uses the software to protect prisons from getting sued, according to an investigation by the Thomson Reuters Foundation.

    Continue reading
  • Battlefield 2042: Please don't be the death knell of the franchise, please don't be the death knell of the franchise

    Another terrible launch, but DICE is already working on improvements

    The RPG Greetings, traveller, and welcome back to The Register Plays Games, our monthly gaming column. Since the last edition on New World, we hit level cap and the "endgame". Around this time, item duping exploits became rife and every attempt Amazon Games made to fix it just broke something else. The post-level 60 "watermark" system for gear drops is also infuriating and tedious, but not something we were able to address in the column. So bear these things in mind if you were ever tempted. On that note, it's time to look at another newly released shit show – Battlefield 2042.

    I wanted to love Battlefield 2042, I really did. After the bum note of the first-person shooter (FPS) franchise's return to Second World War theatres with Battlefield V (2018), I stupidly assumed the next entry from EA-owned Swedish developer DICE would be a return to form. I was wrong.

    The multiplayer military FPS market is dominated by two forces: Activision's Call of Duty (COD) series and EA's Battlefield. Fans of each franchise are loyal to the point of zealotry with little crossover between player bases. Here's where I stand: COD jumped the shark with Modern Warfare 2 in 2009. It's flip-flopped from WW2 to present-day combat and back again, tried sci-fi, and even the Battle Royale trend with the free-to-play Call of Duty: Warzone (2020), which has been thoroughly ruined by hackers and developer inaction.

    Continue reading
  • American diplomats' iPhones reportedly compromised by NSO Group intrusion software

    Reuters claims nine State Department employees outside the US had their devices hacked

    The Apple iPhones of at least nine US State Department officials were compromised by an unidentified entity using NSO Group's Pegasus spyware, according to a report published Friday by Reuters.

    NSO Group in an email to The Register said it has blocked an unnamed customers' access to its system upon receiving an inquiry about the incident but has yet to confirm whether its software was involved.

    "Once the inquiry was received, and before any investigation under our compliance policy, we have decided to immediately terminate relevant customers’ access to the system, due to the severity of the allegations," an NSO spokesperson told The Register in an email. "To this point, we haven’t received any information nor the phone numbers, nor any indication that NSO’s tools were used in this case."

    Continue reading

Biting the hand that feeds IT © 1998–2021