Skip to content

Code Injection in CRI-O

High severity GitHub Reviewed Published Mar 15, 2022 in cri-o/cri-o • Updated Jan 27, 2023

Package

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

Affected versions

>= 1.19.0, < 1.19.6
>= 1.20.0, < 1.20.7
>= 1.21.0, < 1.21.6
>= 1.22.0, < 1.22.3
>= 1.23.0, < 1.23.2

Patched versions

1.19.6
1.20.7
1.21.6
1.22.3
1.23.2

Description

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:

References

@haircommander haircommander published to cri-o/cri-o Mar 15, 2022
Published to the GitHub Advisory Database Mar 15, 2022
Reviewed Mar 15, 2022
Published by the National Vulnerability Database Mar 16, 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
Network
Attack complexity
Low
Privileges required
Low
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:L/UI:N/S:U/C:H/I:H/A:H

EPSS score

0.122%
(48th percentile)

Weaknesses

CVE ID

CVE-2022-0811

GHSA ID

GHSA-6x2m-w449-qwx7

Source code

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