CVE-2023-28642: Github.com/opencontainers/runc Runc AppArmor Bypass With Symlinked Vulnerability

MODERATE
Advisory Identifier: GHSA-g2j6-57v7-gm8c
CVSS 6.1
CWE-59 CWE-281
Published
Advisory Summary

CVE-2023-28642 is a MODERATE (CVSS 6.1) runc apparmor bypass with symlinked vulnerability (CWE-59: Improper Link Resolution Before File Access ('Link Following')) affecting Github.com/opencontainers/runc libraries in the Go ecosystem. The issue involves runc apparmor bypass with symlinked /proc. Remediation is available by upgrading affected packages to version 1.1.5.

CVE-2023-28642 at a Glance

CVE Identifier CVE-2023-28642
GHSA Identifier GHSA-g2j6-57v7-gm8c
Severity MODERATE
CVSS v3.1 Base Score 6.1
CWE Classification CWE-59: Improper Link Resolution Before File Access ('Link Following')
Affected Product Github.com/opencontainers/runc
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.1

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

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

How to Fix CVE-2023-28642

To remediate this vulnerability, upgrade all affected Github.com/opencontainers/runc 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/opencontainers/runc fixed: 1.1.5
Upgrade github.com/opencontainers/runc to 1.1.5
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/opencontainers/runc

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-28642, inspect your project dependencies for Github.com/opencontainers/runc:

inspect dependencies for github.com/opencontainers/runc

Analyze the terminal output to locate any version of Github.com/opencontainers/runc in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.1.5), 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-59: Improper Link Resolution Before File Access ('Link Following'), where the product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource. In Github.com/opencontainers/runc, 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 It was found that AppArmor, and potentially SELinux, can be bypassed when `/proc` inside the container is symlinked with a specific mount configuration. ### Patches Fixed in runc v1.1.5, by prohibiting symlinked `/proc`: https://github.com/opencontainers/runc/pull/3785 This PR fixes CVE-2023-27561 as well. ### Workarounds Avoid using an untrusted container image.

CVE-2023-28642 Affected Github.com/opencontainers/runc Versions

1 component(s)
Fixed Versions:
1.1.5
Product / Package Ecosystem Affected Versions Fixed Version
github.com/opencontainers/runc
Go
< 1.1.5
1.1.5

References

Frequently Asked Questions

What is CVE-2023-28642?
CVE-2023-28642 is a security vulnerability in Github.com/opencontainers/runc involving runc AppArmor bypass with symlinked /proc under CWE-59: Improper Link Resolution Before File Access ('Link Following').
Which Github.com/opencontainers/runc versions are affected?
Affected versions include releases prior to 1.1.5 across affected packages: github.com/opencontainers/runc.
What version fixes CVE-2023-28642?
Upgrading to 1.1.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/opencontainers/runc affected?
Yes, github.com/opencontainers/runc is affected in releases prior to 1.1.5. Upgrade your dependency to 1.1.5 or later.
What is the CVSS score of CVE-2023-28642?
CVE-2023-28642 has a CVSS v3.1 base score of 6.1 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L.
What CWE is associated with CVE-2023-28642?
CVE-2023-28642 is classified under CWE-59: Improper Link Resolution Before File Access ('Link Following') (The product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource.).
How can I check Go dependencies for CVE-2023-28642?
Run the dependency tree command: 'inspect dependencies for github.com/opencontainers/runc'. 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-g2j6-57v7-gm8c",
  "modified" : "2024-12-06T15:31:17Z",
  "published" : "2023-03-30T20:20:23Z",
  "aliases" : [ "CVE-2023-28642" ],
  "summary" : "runc AppArmor bypass with symlinked /proc",
  "details" : "### Impact\nIt was found that AppArmor, and potentially SELinux, can be bypassed when `/proc` inside the container is symlinked with a specific mount configuration.\n\n### Patches\nFixed in runc v1.1.5, by prohibiting symlinked `/proc`: https://github.com/opencontainers/runc/pull/3785\n\nThis PR fixes CVE-2023-27561 as well.\n\n### Workarounds\nAvoid using an untrusted container image.\n\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/opencontainers/runc"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.1.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/opencontainers/runc/security/advisories/GHSA-g2j6-57v7-gm8c"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-28642"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/opencontainers/runc/pull/3785"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/opencontainers/runc"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20241206-0005"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-281", "CWE-59" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-03-30T20:20:23Z",
    "nvd_published_at" : "2023-03-29T19:15:00Z"
  }
}