github.com/cri-o/cri-o
Affected
- introduced
1.29.0, fixed1.29.4(semver)
Fixed versions
1.29.4
Fix
- Fixed version
1.29.4go get github.com/cri-o/[email protected]
Advisory
Also known as: CVE-2024-3154, GO-2024-2791
CRI-O vulnerable to an arbitrary systemd property injection
Impact
On CRI-O, it looks like an arbitrary systemd property can be injected via a Pod annotation:
---
apiVersion: v1
kind: Pod
metadata:
name: poc-arbitrary-systemd-property-injection
annotations:
# I believe that ExecStart with an arbitrary command works here too,
# but I haven't figured out how to marshalize the ExecStart struct to gvariant string.
org.systemd.property.SuccessAction: "'poweroff-force'"
spec:
containers:
- name: hello
image: [quay.io/podman/hello](http://quay.io/podman/hello)
This means that any user who can create a pod with an arbitrary annotation may perform an arbitrary action on the host system.
Tested with CRI-O v1.24 on minikube.
I didn't test the latest v1.29 because it is incompatible with minikube: https://github.com/kubernetes/minikube/pull/18367
Thanks to Cédric Clerget (GitHub ID @cclerget) for finding out that CRI-O just passes pod annotations to OCI annotations:
https://github.com/opencontainers/runc/pull/3923#discussion_r1532292536
CRI-O has to filter out annotations that have the prefix "org.systemd.property."
See also:
Workarounds
Unfortunately, the only workarounds would involve an external mutating webhook to disallow these annotations
References
High Basis: The source's own band: HIGH
1.29.0, fixed 1.29.4 (semver)1.29.4
1.29.4go get github.com/cri-o/[email protected]1.28.0, fixed 1.28.6 (semver)1.28.6
1.28.6go get github.com/cri-o/[email protected]0, fixed 1.27.6 (semver)1.27.6
1.27.6go get github.com/cri-o/[email protected]Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0