CVE-2022-0811: Github.com/cri o/cri o Code Injection Vulnerability

HIGH
Advisory Identifier: GHSA-6x2m-w449-qwx7
CVSS 8.8
CWE-94
Published
Advisory Summary

CVE-2022-0811 is a HIGH (CVSS 8.8) code injection vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Github.com/cri o/cri o libraries in the Go ecosystem. The issue involves code injection in cri-o. Remediation is available by upgrading affected packages to version 1.19.6, 1.20.7, 1.21.6, 1.22.3, 1.23.2.

CVE-2022-0811 at a Glance

CVE Identifier CVE-2022-0811
GHSA Identifier GHSA-6x2m-w449-qwx7
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Github.com/cri o/cri o
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 8.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2022-0811

To remediate this vulnerability, upgrade all affected Github.com/cri o/cri o dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/cri-o/cri-o fixed: 1.19.6
Upgrade github.com/cri-o/cri-o to 1.19.6
github.com/cri-o/cri-o fixed: 1.20.7
Upgrade github.com/cri-o/cri-o to 1.20.7
github.com/cri-o/cri-o fixed: 1.21.6
Upgrade github.com/cri-o/cri-o to 1.21.6
github.com/cri-o/cri-o fixed: 1.22.3
Upgrade github.com/cri-o/cri-o to 1.22.3
github.com/cri-o/cri-o fixed: 1.23.2
Upgrade github.com/cri-o/cri-o to 1.23.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/cri-o/cri-o

How to Check if You Are Affected

To determine whether your application is affected by CVE-2022-0811, inspect your project dependencies for Github.com/cri o/cri o:

inspect dependencies for github.com/cri-o/cri-o

Analyze the terminal output to locate any version of Github.com/cri o/cri o in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.19.6), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Github.com/cri o/cri o, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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](https://kubernetes.io/docs/tasks/administer-cluster/sysctl-cluster/#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: * Open an issue in [the CRI-O repo](http://github.com/cri-o/cri-o/issues) * To make a report, email your vulnerability to the private [cncf-crio-security@lists.cncf.io](mailto:cncf-crio-security@lists.cncf.io) list with the security details and the details expected for [all CRI-O bug reports](https://github.com/cri-o/cri-o/blob/main/.github/ISSUE_TEMPLATE/bug-report.yml).

CVE-2022-0811 Affected Github.com/cri o/cri o Versions

5 component(s)
Fixed Versions:
1.19.61.20.71.21.61.22.31.23.2
Product / Package Ecosystem Affected Versions Fixed Version
github.com/cri-o/cri-o
Go
≥ 1.19.0
< 1.19.6
1.19.6
github.com/cri-o/cri-o
Go
≥ 1.20.0
< 1.20.7
1.20.7
github.com/cri-o/cri-o
Go
≥ 1.21.0
< 1.21.6
1.21.6
github.com/cri-o/cri-o
Go
≥ 1.22.0
< 1.22.3
1.22.3
github.com/cri-o/cri-o
Go
≥ 1.23.0
< 1.23.2
1.23.2

References

Frequently Asked Questions

What is CVE-2022-0811?
CVE-2022-0811 is a security vulnerability in Github.com/cri o/cri o involving Code Injection in CRI-O under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Github.com/cri o/cri o versions are affected?
Affected versions include releases prior to 1.19.6, 1.20.7, 1.21.6, 1.22.3, 1.23.2 across affected packages: github.com/cri-o/cri-o.
What version fixes CVE-2022-0811?
Upgrading to 1.19.6, 1.20.7, 1.21.6, 1.22.3, 1.23.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/cri-o/cri-o affected?
Yes, github.com/cri-o/cri-o is affected in releases prior to 1.19.6, 1.20.7, 1.21.6, 1.22.3, 1.23.2. Upgrade your dependency to 1.19.6, 1.20.7, 1.21.6, 1.22.3, 1.23.2 or later.
What is the CVSS score of CVE-2022-0811?
CVE-2022-0811 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2022-0811?
CVE-2022-0811 is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.).
How can I check Go dependencies for CVE-2022-0811?
Run the dependency tree command: 'inspect dependencies for github.com/cri-o/cri-o'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-6x2m-w449-qwx7",
  "modified" : "2022-03-18T17:47:49Z",
  "published" : "2022-03-15T20:13:38Z",
  "aliases" : [ "CVE-2022-0811" ],
  "summary" : "Code Injection in CRI-O",
  "details" : "### Impact\nA 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.\n\n### Patches\nThe patches will be present in 1.19.6, 1.20.7, 1.21.6, 1.22.3, 1.23.2, 1.24.0\n\n### Workarounds\n- 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.\n- An admission webhook could be created to deny pods that specify a `+` in the sysctl value of a pod.\n- A [PodSecurityPolicy](https://kubernetes.io/docs/tasks/administer-cluster/sysctl-cluster/#podsecuritypolicy) [deprecated] could be created, specifying all sysctls as forbidden like so: \n```\napiVersion: policy/v1beta1\nkind: PodSecurityPolicy\nmetadata:\n  name: sysctl-psp\nspec:\n  forbiddenSysctls:\n    - \"*\"\n```\nHowever, this option will not work if any sysctls are required by any pods in the cluster.\n\n\n### Credits\nCredit for finding this vulnerability goes to John Walker and Manoj Ahuje of Crowdstrike. The CRI-O community deeply thanks them for the report.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [the CRI-O repo](http://github.com/cri-o/cri-o/issues)\n* To make a report, email your vulnerability to the private\n[cncf-crio-security@lists.cncf.io](mailto:cncf-crio-security@lists.cncf.io) list\nwith the security details and the details expected for [all CRI-O bug\nreports](https://github.com/cri-o/cri-o/blob/main/.github/ISSUE_TEMPLATE/bug-report.yml).\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/cri-o/cri-o"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.19.0"
      }, {
        "fixed" : "1.19.6"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/cri-o/cri-o"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.20.0"
      }, {
        "fixed" : "1.20.7"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/cri-o/cri-o"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.21.0"
      }, {
        "fixed" : "1.21.6"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/cri-o/cri-o"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.22.0"
      }, {
        "fixed" : "1.22.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/cri-o/cri-o"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.23.0"
      }, {
        "fixed" : "1.23.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/cri-o/cri-o/security/advisories/GHSA-6x2m-w449-qwx7"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-0811"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/security/cve/CVE-2022-0811"
  }, {
    "type" : "WEB",
    "url" : "https://bugs.gentoo.org/835336"
  }, {
    "type" : "WEB",
    "url" : "https://bugzilla.redhat.com/show_bug.cgi?id=2059475"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/cri-o/cri-o"
  }, {
    "type" : "WEB",
    "url" : "https://www.crowdstrike.com/blog/cr8escape-zero-day-vulnerability-discovered-in-cri-o-container-engine-cve-2022-0811"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-94" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-03-15T20:13:38Z",
    "nvd_published_at" : "2022-03-16T15:15:00Z"
  }
}