Cross-Account Container Takeover in Azure Container Instances
unit42.paloaltonetworks.com
unit42.paloaltonetworks.com
tl;dr
- Microsoft uses an old version of runc (from 20216), with known vulnerabilities. runc is a container runtime. Researchers, using work from 2019, were able to break out of the container into the Kubernetes node.
- Microsoft, to fix a known vulnerability (instead of patching!) in Kubernetes with `kubectl exec` has a custom solution (`bridge-pod`) that handles sending `kubectl exec` commands to nodes.
- In Microsoft's custom solution, the HTTP request to run `kubectl exec` on the node sent from `bridge-pod` includes an access token with overly broad privileges in the header (not necessary in this case). If you monitor traffic once you've escape the container on the node, you can extract this access token if you send a command to your own container from the Azure CLI.
- Access token grants `pod/exec` rights to anything in the cluster
The egregious part is the `bridge-pod` and it's implementation. This wasn't just outdated software left unpatched, it was badly implemented hacks to work around their inability to patch.
1 - https://www.wiz.io/blog/chaosdb-how-we-hacked-thousands-of-a...
* RunC v1.0.0-rc2 was released on Oct. 1, 2016, and was vulnerable to at least two container breakout CVEs.
* ACI was hosted on clusters running either Kubernetes v1.8.4, v1.9.10 or v1.10.9. These versions were released between November 2017 and October 2018 and are vulnerable to multiple publicly known vulnerabilities.
Running multitenant workloads in Kubernetes is notoriously difficult, and staying on top of patches is simply table-stakes.
Eg https://play.rust-lang.org/?version=stable&mode=debug&editio... - A serializer not only detects characters that are completely illegal, but also escapes characters that need escaping to be legal.
Given such an obvious piece of external evidence that the IMS has failed (not keeping the software up to date, internal audit not detecting the software is out of date,etc, all the way through to an external incident occurring due to this failure) you have to wonder whether there should be some greater repercussion/ outcome than just "we fixed the vuln".
I would very much want to hear what they're doing to fix eg. the internal audit. Root cause on this is a management failure.
At that scale "up to date" is not the same as for a standard tech company. It's possible that they run old but custom patched versions in the same way RedHat shipped old kernels with hundreds of patches on top.
It certainly is a management failure, but people jumping to conclusion here about old versions may be missing the mark.
There should be an in-depth analysis from this, but I don't think it's safe to really draw conclusions about their processes from what we know from this exploit alone.
One the one hand we have an old version with a known vulnerability that was successfully exploited.
On the other hand we have a backporting process for 5 years that applied fixes to this and a large number of other issues but missed the exploitable vulnerability.
Sure we can come up with imaginary scenarios where the second option is possible, but when reasoning about a scenario from limited information I generally go with the simplest possible explanation.
However we have several signals from the researcher side, and no signals (that I've seen) from the vendor side and all of the signals point to a lack of patching.
In this case are there any signals you've seen that point to silent backporting that missed the exploited vulnerabilities?
I have to say, this is so bad/out of date that I wouldn't use ACI for any business needs until I see a live dashboard with the versions of the software they're running so I can look for CVEs. I might as well host my business apps on an early 2000s shared web hosting provider.
I'll take my chances with microsoft. Better features & much lower cost....
Azure's light years ahead in MANY areas, if you bother to take a look and learn about it.....
So many features that ought to be orthogonal, but aren't. Remind me again why I can't have an IPv4 NAT gateway in an IPv6-enabled vNet?
Kubernetes is also not the only area where Azure is woefully behind on updates. They haven't even kept up with Microsoft products. For example, they still use the deprecated VHD format, even though VHDX has been a thing for 5 years now.
If one can, one should probably "go boutique", where the power balance is a bit more favourable to customers and vendors do really care about their products and their reputation.
Anything close? AWS is overly wordy cluttered water trash.
Engineer working on GVisor for Google had this to say https://twitter.com/IanMLewis/status/1436390377716523011
Amazon’s ECS launched in 2014. Is that not container hosting as a service?
> "With ACI, customers can deploy containers to Azure without managing the underlying infrastructure"
ECS was launched on 2014, but was implemented as an agent on an EC2 instance. AWS's completely managed container solution (Fargate) went GA in Nov 2017.