Host `docker` binary overwrite from Kata VM
Kata Containers, used in Bitbucket Pipelines, allowed a VM to write to hostPath mount points that should have been read-only. An attacker could overwrite the host's docker binary, potentially leading to remote code execution.
Bugcrowd
Originally disclosed on Bugcrowd
- Accepted in 22 days
- Fixed in 23 days
- Disclosed after 34 days
Summary by ajxchapman
Kata Containers, as used in the new BitBucket Pipelines CI/CD environment, was found to be vulnerable to an issue allowing Kata VMs to write to hostPath mount points which should have been read only. This issue was fixed in the Kata Containers project and assigned CVE-2020-28914.
Report details
-
Submitted
26 Oct 2020 18:36:59 UTC
-
Target Location
Bitbucket Attack Scenarios listed below -
Target category
Web App
-
VRT
Server-Side Injection > Remote Code Execution (RCE)
-
Priority
P1
-
Bug URL
Empty
-
Description
Hi Team,
I have managed to overwrite the host
dockerbinary (possibly/usr/bin/docker) from within a Kata VM. Unfortunately I had an error in my PoC which meant that I corrupted the originaldockerbinary. I have since managed to replace the binary with a newer version of docker, so things in the Kata environment should continue to work (I hope).I will get a report written up today, but unfortunately I have to take a break for childcare right now. I just wanted to give you a heads up that any weirdness you see in the Kata environment is probably my fault.
Thanks, Alex
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely a misconfiguration in Kata Containers that mounted host paths as writable when they should have been read-only.
Impact
An attacker could overwrite the host's docker binary, potentially leading to remote code execution on the host.
What the attacker needed
Access to a Kata VM in Bitbucket Pipelines
The fix
The issue was fixed in the Kata Containers project.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Kata Containers is a system that runs each container inside a lightweight virtual machine for extra isolation. The bug meant that a program inside that virtual machine could write to files on the real host that were supposed to be read-only, like the docker program itself. This could let an attacker replace important host programs with their own code.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.