CVE-2023-6476: Github.com/cri o/cri o Remote Code Execution Vulnerability

MODERATE
Advisory Identifier: GHSA-p4rx-7wvg-fwrc
CVSS 6.5
CWE-400 CWE-770
Published
Advisory Summary

CVE-2023-6476 is a MODERATE (CVSS 6.5) remote code execution vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Github.com/cri o/cri o libraries in the Go ecosystem. The issue involves cri-o's pods can break out of resource confinement on cgroupv2. Remediation is available by upgrading affected packages to version 1.29.1, 1.28.3, 1.27.3.

CVE-2023-6476 at a Glance

CVE Identifier CVE-2023-6476
GHSA Identifier GHSA-p4rx-7wvg-fwrc
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Github.com/cri o/cri o
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.5

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:N/I:N/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 None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2023-6476

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.29.1
Upgrade github.com/cri-o/cri-o to 1.29.1
github.com/cri-o/cri-o fixed: 1.28.3
Upgrade github.com/cri-o/cri-o to 1.28.3
github.com/cri-o/cri-o fixed: 1.27.3
Upgrade github.com/cri-o/cri-o to 1.27.3
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-2023-6476, 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.29.1), 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-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. 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 _What kind of vulnerability is it? Who is impacted?_ All versions of CRI-O running on cgroupv2 nodes. Unchecked access to an experimental annotation allows a container to be unconfined. Back in 2021, [support was added](https://github.com/cri-o/cri-o/pull/4479) to support an experimental annotation that allows a user to request special resources in cgroupv2. It was supposed to be gated by an experimental annotation: `io.kubernetes.cri-o.UnifiedCgroup`, which was supposed to be filtered from the [list of allowed annotations](https://github.com/cri-o/cri-o/blob/main/pkg/config/workloads.go#L103-L107) . However, there is a bug in this code which allows any user to specify this annotation, regardless of whether it's enabled on the node. The consequences of this are a pod can specify any amount of memory/cpu and get it, circumventing the kubernetes scheduler, and potentially be able to DOS a node. ### Patches _Has the problem been patched? What versions should users upgrade to?_ 1.29.1, 1.28.3, 1.27.3 ### Workarounds _Is there a way for users to fix or remediate the vulnerability without upgrading?_ use cgroupv1 ### References _Are there any links users can visit to find out more?_

CVE-2023-6476 Affected Github.com/cri o/cri o Versions

3 component(s)
Fixed Versions:
1.29.11.28.31.27.3
Product / Package Ecosystem Affected Versions Fixed Version
github.com/cri-o/cri-o
Go
≥ 1.29.0
< 1.29.1
All 1 versions
1.29.0
1.29.1
github.com/cri-o/cri-o
Go
≥ 1.28.0
< 1.28.3
1.28.3
github.com/cri-o/cri-o
Go
< 1.27.3
1.27.3

References

Frequently Asked Questions

What is CVE-2023-6476?
CVE-2023-6476 is a security vulnerability in Github.com/cri o/cri o involving CRI-O's pods can break out of resource confinement on cgroupv2 under CWE-400: Uncontrolled Resource Consumption.
Which Github.com/cri o/cri o versions are affected?
Affected versions include releases prior to 1.29.1, 1.28.3, 1.27.3 across affected packages: github.com/cri-o/cri-o.
What version fixes CVE-2023-6476?
Upgrading to 1.29.1, 1.28.3, 1.27.3 (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.29.1, 1.28.3, 1.27.3. Upgrade your dependency to 1.29.1, 1.28.3, 1.27.3 or later.
What is the CVSS score of CVE-2023-6476?
CVE-2023-6476 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2023-6476?
CVE-2023-6476 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check Go dependencies for CVE-2023-6476?
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-p4rx-7wvg-fwrc",
  "modified" : "2024-01-10T15:27:45Z",
  "published" : "2024-01-10T15:27:45Z",
  "aliases" : [ "CVE-2023-6476" ],
  "summary" : "CRI-O's pods can break out of resource confinement on cgroupv2",
  "details" : "### Impact\n_What kind of vulnerability is it? Who is impacted?_\nAll versions of CRI-O running on cgroupv2 nodes. \nUnchecked access to an experimental annotation allows a container to be unconfined. Back in 2021, [support was added](https://github.com/cri-o/cri-o/pull/4479) to support an experimental annotation that allows a user to request special resources in cgroupv2. It was supposed to be gated by an experimental annotation: `io.kubernetes.cri-o.UnifiedCgroup`, which was supposed to be filtered from the [list of allowed annotations](https://github.com/cri-o/cri-o/blob/main/pkg/config/workloads.go#L103-L107) . However, there is a bug in this code which allows any user to specify this annotation, regardless of whether it's enabled on the node. The consequences of this are a pod can specify any amount of memory/cpu and get it, circumventing the kubernetes scheduler, and potentially be able to DOS a node. \n### Patches\n_Has the problem been patched? What versions should users upgrade to?_\n1.29.1, 1.28.3, 1.27.3\n\n### Workarounds\n_Is there a way for users to fix or remediate the vulnerability without upgrading?_\nuse cgroupv1\n\n### References\n_Are there any links users can visit to find out more?_\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/cri-o/cri-o"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.29.0"
      }, {
        "fixed" : "1.29.1"
      } ]
    } ],
    "versions" : [ "1.29.0" ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/cri-o/cri-o"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.28.0"
      }, {
        "fixed" : "1.28.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/cri-o/cri-o"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.27.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/cri-o/cri-o/security/advisories/GHSA-p4rx-7wvg-fwrc"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-6476"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cri-o/cri-o/pull/4479"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cri-o/cri-o/commit/75effcb1a25851a736e82dba1f7d8cee93ee159e"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2024:0195"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2024:0207"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/security/cve/CVE-2023-6476"
  }, {
    "type" : "WEB",
    "url" : "https://bugzilla.redhat.com/show_bug.cgi?id=2253994"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/cri-o/cri-o"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cri-o/cri-o/blob/main/pkg/config/workloads.go#L103-L107"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400", "CWE-770" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-01-10T15:27:45Z",
    "nvd_published_at" : "2024-01-09T22:15:43Z"
  }
}