Skip to content

Access to Unix domain socket can lead to privileges escalation in Cilium

High severity GitHub Reviewed Published May 16, 2022 in cilium/cilium • Updated Jan 27, 2023

Package

gomod github.com/cilium/cilium (Go)

Affected versions

>= 1.11.0, < 1.11.5
>= 1.10.0, < 1.10.11
< 1.9.16

Patched versions

1.11.5
1.10.11
1.9.16

Description

Impact

Users with host file system access on a node and the privileges to run as group ID 1000 can gain access to the per node API of Cilium via Unix domain socket on the host where Cilium is running. If a malicious user is able to gain unprivileged access to a user corresponding to this group, then they can leverage this access to compromise the integrity as well as system availability on that host. Operating Systems that have unprivileged users not belonging the group ID 1000 are not affected by this vulnerability.

Best practices for managing the secure deployment of Kubernetes clusters will typically limit the ability for a malicious user to deploy pods with access to this group or to access the host filesystem, and limit user access to the nodes for users belonging to this group. These best practices include (but are not limited to) enforcing Admission Control policies to limit the configuration of Kubernetes Pod hostPath and SecurityContext fields.

Patches

Cilium versions >=1.9.16, >=1.10.11, >=1.11.5 mitigate this issue by setting the default group to 0 (root).

Workarounds

Prevent Cilium from running with group 1000 by modifying Cilium's DaemonSet to run with the following command:

      containers:
      - name: cilium-agent
        args:
        - -c
        - "groupdel cilium && cilium-agent --config-dir=/tmp/cilium/config-map"
        command:
        - bash

instead of

      containers:
      - name: cilium-agent
        args:
        - --config-dir=/tmp/cilium/config-map
        command:
        - cilium-agent

Acknowledgements

The Cilium community has worked together with members of Isovalent and Form 3 to prepare these mitigations. Special thanks to Daniel Iziourov and Daniel Teixeira for their cooperation.

For more information

If you have any questions or comments about this advisory:

References

@joestringer joestringer published to cilium/cilium May 16, 2022
Published by the National Vulnerability Database May 20, 2022
Published to the GitHub Advisory Database May 24, 2022
Reviewed May 24, 2022
Last updated Jan 27, 2023

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
Local
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Changed
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:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H

EPSS score

0.042%
(5th percentile)

Weaknesses

CVE ID

CVE-2022-29178

GHSA ID

GHSA-6p8v-8cq8-v2r3

Source code

github.com/cilium/cilium

Credits

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