CVE-2022-0811
CVE-2022-0811 is a vulnerability in CRI-O (a container runtime engine underpinning Kubernetes). Dubbed “cr8escape,” when invoked, an attacker could escape from a Kubernetes container and gain root access to the host and be able to move anywhere in the cluster. Invocation of CVE-2022-0811 can allow an attacker to perform a variety of actions on objectives, including execution of malware, exfiltration of data and lateral movement across pods.
Proof-of-Concept
My notes from using CVE-2022-0811 to pwn the machine 'Vessel' on HackTheBox.
SUID bit on /usr/bin/pinns:
ethan@vessel:/$ ls -al /usr/bin/pinns
-rwsr-x--- 1 root ethan 814936 Mar 15 18:18 /usr/bin/pinnsConfirm crio version is 1.19:
ethan@vessel:/$ crio --version
crio version 1.19.6
Version: 1.19.6
GitCommit: c12bb210e9888cf6160134c7e636ee952c45c05a
GitTreeState: clean
BuildDate: 2022-03-15T18:18:24Z
GoVersion: go1.15.2
Compiler: gc
Platform: linux/amd64
Linkmode: dynamicReading about the exploit we should (1) create a pod/container, (2) use pinns to exploit the vulnerable variable kernel.core_pattern, (3) trigger a core dump and then reap the rewards. More information here: CVE-2022-0811
Create a container using
kubectl,minikube,dockerorrunc.
Open a second terminal and write a simple PoC script to be executed
From the same terminal, run the malicious pinns command:
Verify that netns and utsns are created in /tmp/pthree from the container:
In the first terminal (runc container) trigger a core dump to run the script:
Verify in the second terminal that the script was executed
Last updated
Was this helpful?