CVE-2022-29162: Github.com/opencontainers/runc Default Inheritable Capabilities For Linux Vulnerability

MODERATE
Advisory Identifier: GHSA-f3fp-gc8g-vw66
CVSS 5.9
CWE-276
Published
Advisory Summary

CVE-2022-29162 is a MODERATE (CVSS 5.9) default inheritable capabilities for linux vulnerability (CWE-276: Incorrect Default Permissions) affecting Github.com/opencontainers/runc libraries in the Go ecosystem. The issue involves default inheritable capabilities for linux container should be empty. Remediation is available by upgrading affected packages to version 1.1.2.

CVE-2022-29162 at a Glance

CVE Identifier CVE-2022-29162
GHSA Identifier GHSA-f3fp-gc8g-vw66
Severity MODERATE
CVSS v3.1 Base Score 5.9
CWE Classification CWE-276: Incorrect Default Permissions
Affected Product Github.com/opencontainers/runc
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.9

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:N/S:U/C:L/I:L/A:L).

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

How to Fix CVE-2022-29162

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.2
Upgrade github.com/opencontainers/runc to 1.1.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/opencontainers/runc

How to Check if You Are Affected

To determine whether your application is affected by CVE-2022-29162, 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.2), 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-276: Incorrect Default Permissions, where during installation, installed file permissions are set to allow anyone to modify those files. 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 A bug was found in runc where `runc exec --cap` executed processes with non-empty inheritable Linux process capabilities, creating an atypical Linux environment and enabling programs with inheritable file capabilities to elevate those capabilities to the permitted set during execve(2). This bug did not affect the container security sandbox as the inheritable set never contained more capabilities than were included in the container's bounding set. ### Patches This bug has been fixed in runc 1.1.2. Users should update to this version as soon as possible. This fix changes `runc exec --cap` behavior such that the additional capabilities granted to the process being executed (as specified via `--cap` arguments) do not include inheritable capabilities. In addition, `runc spec` is changed to not set any inheritable capabilities in the created example OCI spec (`config.json`) file. ### Credits The opencontainers project would like to thank [Andrew G. Morgan](https://github.com/AndrewGMorgan) for responsibly disclosing this issue in accordance with the [opencontainers org security policy](https://github.com/opencontainers/.github/blob/master/SECURITY.md). ### For more information If you have any questions or comments about this advisory: * [Open an issue](https://github.com/opencontainers/runc/issues/new) * Email us at [security@opencontainers.org](mailto:security@opencontainers.org) if you think you’ve found a security bug

CVE-2022-29162 Affected Github.com/opencontainers/runc Versions

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

References

Frequently Asked Questions

What is CVE-2022-29162?
CVE-2022-29162 is a security vulnerability in Github.com/opencontainers/runc involving Default inheritable capabilities for linux container should be empty under CWE-276: Incorrect Default Permissions.
Which Github.com/opencontainers/runc versions are affected?
Affected versions include releases prior to 1.1.2 across affected packages: github.com/opencontainers/runc.
What version fixes CVE-2022-29162?
Upgrading to 1.1.2 (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.2. Upgrade your dependency to 1.1.2 or later.
What is the CVSS score of CVE-2022-29162?
CVE-2022-29162 has a CVSS v3.1 base score of 5.9 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L.
What CWE is associated with CVE-2022-29162?
CVE-2022-29162 is classified under CWE-276: Incorrect Default Permissions (During installation, installed file permissions are set to allow anyone to modify those files.).
How can I check Go dependencies for CVE-2022-29162?
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-f3fp-gc8g-vw66",
  "modified" : "2023-03-27T22:23:50Z",
  "published" : "2022-05-24T17:36:56Z",
  "aliases" : [ "CVE-2022-29162" ],
  "summary" : "Default inheritable capabilities for linux container should be empty",
  "details" : "### Impact\n\nA bug was found in runc where `runc exec --cap` executed processes with non-empty inheritable Linux process capabilities, creating an atypical Linux environment and enabling programs with inheritable file capabilities to elevate those capabilities to the permitted set during execve(2).\n\nThis bug did not affect the container security sandbox as the inheritable set never contained more capabilities than were included in the container's bounding set.\n\n### Patches\nThis bug has been fixed in runc 1.1.2. Users should update to this version as soon as possible.\n\nThis fix changes `runc exec --cap` behavior such that the additional capabilities granted to the process being executed (as specified via `--cap` arguments) do not include inheritable capabilities.\n\nIn addition, `runc spec` is changed to not set any inheritable capabilities in the created example OCI spec (`config.json`) file.\n\n### Credits\nThe opencontainers project would like to thank [Andrew G. Morgan](https://github.com/AndrewGMorgan) for responsibly disclosing this issue in accordance with the [opencontainers org security policy](https://github.com/opencontainers/.github/blob/master/SECURITY.md).\n\n### For more information\nIf you have any questions or comments about this advisory:\n\n* [Open an issue](https://github.com/opencontainers/runc/issues/new)\n* Email us at [security@opencontainers.org](mailto:security@opencontainers.org) if you think you’ve found a security bug",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/opencontainers/runc"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.1.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/opencontainers/runc/security/advisories/GHSA-f3fp-gc8g-vw66"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-29162"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/opencontainers/runc/commit/d04de3a9b72d7a2455c1885fc75eb36d02cd17b5"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/opencontainers/runc/releases/tag/v1.1.2"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2023/03/msg00023.html"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/AVPZBV7ISA7QKRPTC7ZXWKMIQI2HZEBB"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/D77CKD3AXPMU4PMQIQI5Q74SI4JATNND"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/GPQU4YC4AAY54JDXGDQHJEYKSXXG5T2Y"
  }, {
    "type" : "PACKAGE",
    "url" : "github.com/opencontainers/runc"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-276" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-05-24T17:36:56Z",
    "nvd_published_at" : "2022-05-17T21:15:00Z"
  }
}