Lucene search

K
githubGitHub Advisory DatabaseGHSA-6X2M-W449-QWX7
HistoryMar 15, 2022 - 8:13 p.m.

Code Injection in CRI-O

2022-03-1520:13:38
CWE-94
GitHub Advisory Database
github.com
15
cri-o
code injection
security advisory
podsecuritypolicy
kernel parameter
vulnerability
patch
sysctl
admission webhook
crowdstrike
cri-o repo

CVSS2

9

Attack Vector

NETWORK

Attack Complexity

LOW

Authentication

SINGLE

Confidentiality Impact

COMPLETE

Integrity Impact

COMPLETE

Availability Impact

COMPLETE

AV:N/AC:L/Au:S/C:C/I:C/A:C

CVSS3

8.8

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

LOW

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

HIGH

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

EPSS

0.001

Percentile

46.8%

Impact

A flaw introduced in CRI-O version 1.19 which an attacker can use to bypass the safeguards and set arbitrary kernel parameters on the host. As a result, anyone with rights to deploy a pod on a Kubernetes cluster that uses the CRI-O runtime can abuse the kernel.core_pattern kernel parameter to achieve container escape and arbitrary code execution as root on any node in the cluster.

Patches

The patches will be present in 1.19.6, 1.20.7, 1.21.6, 1.22.3, 1.23.2, 1.24.0

Workarounds

  • Users can set manage_ns_lifecycle to false, which causes the sysctls to be configured by the OCI runtime, which typically filter these cases. This option is available in 1.20 and 1.19. Newer versions don’t have this option.
  • An admission webhook could be created to deny pods that specify a + in the sysctl value of a pod.
  • A PodSecurityPolicy [deprecated] could be created, specifying all sysctls as forbidden like so:
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
  name: sysctl-psp
spec:
  forbiddenSysctls:
    - "*"

However, this option will not work if any sysctls are required by any pods in the cluster.

Credits

Credit for finding this vulnerability goes to John Walker and Manoj Ahuje of Crowdstrike. The CRI-O community deeply thanks them for the report.

For more information

If you have any questions or comments about this advisory:

Affected configurations

Vulners
Node
kubernetescri-oRange<1.23.2
OR
kubernetescri-oRange<1.22.3
OR
kubernetescri-oRange<1.21.6
OR
kubernetescri-oRange<1.20.7
OR
kubernetescri-oRange<1.19.6
VendorProductVersionCPE
kubernetescri-o*cpe:2.3:a:kubernetes:cri-o:*:*:*:*:*:*:*:*

CVSS2

9

Attack Vector

NETWORK

Attack Complexity

LOW

Authentication

SINGLE

Confidentiality Impact

COMPLETE

Integrity Impact

COMPLETE

Availability Impact

COMPLETE

AV:N/AC:L/Au:S/C:C/I:C/A:C

CVSS3

8.8

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

LOW

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

HIGH

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

EPSS

0.001

Percentile

46.8%