CVE-2019-19921: Github.com/opencontainers/runc Opencontainers Runc Contains Procfs Race Vulnerability

MODERATE
Advisory Identifier: GHSA-fh74-hm69-rqjw
CVSS 5.9
CWE-362 CWE-706
Published
Advisory Summary

CVE-2019-19921 is a MODERATE (CVSS 5.9) opencontainers runc contains procfs race vulnerability (CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')) affecting Github.com/opencontainers/runc libraries in the Go ecosystem. The issue involves opencontainers runc contains procfs race condition with a shared volume mount. Remediation is available by upgrading affected packages to version 1.0.0-rc9.0.20200122160610-2fc03cc11c77.

CVE-2019-19921 at a Glance

CVE Identifier CVE-2019-19921
GHSA Identifier GHSA-fh74-hm69-rqjw
Severity MODERATE
CVSS v3.1 Base Score 5.9
CWE Classification CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
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:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N/E:U/RL:U/RC:U).

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

How to Fix CVE-2019-19921

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.0.0-rc9.0.20200122160610-2fc03cc11c77
Upgrade github.com/opencontainers/runc to 1.0.0-rc9.0.20200122160610-2fc03cc11c77
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-2019-19921, 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.0.0-rc9.0.20200122160610-2fc03cc11c77), 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-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition'), where the product contains a concurrent code sequence that requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence operating concurrently. 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 By crafting a malicious root filesystem (with `/proc` being a symlink to a directory which was inside a volume shared with another running container), an attacker in control of both containers can trick `runc` into not correctly configuring the container's security labels and not correctly masking paths inside `/proc` which contain potentially-sensitive information about the host (or even allow for direct attacks against the host). In order to exploit this bug, an untrusted user must be able to spawn custom containers with custom mount configurations (such that a volume is shared between two containers). It should be noted that we consider this to be a fairly high level of access for an untrusted user -- and we do not recommend allowing completely untrusted users to have such degrees of access without further restrictions. ### Specific Go Package Affected github.com/opencontainers/runc/libcontainer ### Patches This vulnerability has been fixed in `1.0.0-rc10`. It should be noted that the current fix is effectively a hot-fix, and there are known ways for it to be worked around (such as making the entire root filesystem a shared volume controlled by another container). We recommend that users review their access policies to ensure that untrusted users do not have such high levels of controls over container mount configuration. ### Workarounds If you are not providing the ability for untrusted users to configure mountpoints for `runc` (or through a higher-level tool such as `docker run -v`) then you are not vulnerable to this issue. This exploit requires fairly complicated levels of access (which are available for some public clouds but are not necessarily available for all deployments). Additionally, it appears as though it is not possible to exploit this vulnerability through Docker (due to the order of mounts Docker generates). However you should not depend on this, as it may be possible to work around this roadblock. ### Credits This vulnerability was discovered by Cure53, as part of a third-party security audit. ### 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 [dev@opencontainers.org](mailto:dev@opencontainers.org), or [security@opencontainers.org](mailto:security@opencontainers.org) if you think you've found a security bug.

CVE-2019-19921 Affected Github.com/opencontainers/runc Versions

1 component(s)
Fixed Versions:
1.0.0-rc9.0.20200122160610-2fc03cc11c77
Product / Package Ecosystem Affected Versions Fixed Version
github.com/opencontainers/runc
Go
< 1.0.0-rc9.0.20200122160610-2fc03cc11c77
1.0.0-rc9.0.20200122160610-2fc03cc11c77

References

Github.com/opencontainers/runc Source Repository REPOSITORY
https://github.com/opencontainers/runc/pull/2207
GitHub Advisory / Wiki ADVISORY
https://github.com/opencontainers/runc/security/advisories/GHSA-fh74-hm69-rqjw
NVD — CVE-2019-19921 NVD
https://nvd.nist.gov/vuln/detail/CVE-2019-19921
Github.com/opencontainers/runc Source Repository REPOSITORY
https://github.com/opencontainers/runc/issues/2197
Github.com/opencontainers/runc Source Repository REPOSITORY
https://github.com/opencontainers/runc/pull/2190
Security Fix Commit FIX COMMIT
https://github.com/opencontainers/runc/commit/2fc03cc11c775b7a8b2e48d7ee447cb9bef32ad0
usn.ubuntu.com/4297-1 WEB
https://usn.ubuntu.com/4297-1
Github.com/opencontainers/runc Security Information SECURITY
https://security.gentoo.org/glsa/202003-21
Github.com/opencontainers/runc Security Information SECURITY
https://security-tracker.debian.org/tracker/CVE-2019-19921
pkg.go.dev/vuln/go-2021-0087 WEB
https://pkg.go.dev/vuln/GO-2021-0087
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/I6BF24VCZRFTYBTT3T7HDZUOTKOTNPLZ
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/FYVE3GB4OG3BNT5DLQHYO4M5SXX33AQ5
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/FNB2UEDIIJCRQW4WJLZOPQJZXCVSXMLD
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/DHGVGGMKGZSJ7YO67TGGPFEHBYMS63VF
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ANUGDBJ7NBUMSUFZUSKU3ZMQYZ2Z3STN
lists.debian.org/debian-lts-announce... WEB
https://lists.debian.org/debian-lts-announce/2023/03/msg00023.html
Github.com/opencontainers/runc Source Repository REPOSITORY
https://github.com/opencontainers/runc/releases
access.redhat.com/errata/rhsa-2020:06... WEB
https://access.redhat.com/errata/RHSA-2020:0695
access.redhat.com/errata/rhsa-2020:06... WEB
https://access.redhat.com/errata/RHSA-2020:0688
Github.com/opencontainers/runc Security Information SECURITY
http://lists.opensuse.org/opensuse-security-announce/2020-02/msg00018.html

Frequently Asked Questions

What is CVE-2019-19921?
CVE-2019-19921 is a security vulnerability in Github.com/opencontainers/runc involving opencontainers runc contains procfs race condition with a shared volume mount under CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition').
Which Github.com/opencontainers/runc versions are affected?
Affected versions include releases prior to 1.0.0-rc9.0.20200122160610-2fc03cc11c77 across affected packages: github.com/opencontainers/runc.
What version fixes CVE-2019-19921?
Upgrading to 1.0.0-rc9.0.20200122160610-2fc03cc11c77 (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.0.0-rc9.0.20200122160610-2fc03cc11c77. Upgrade your dependency to 1.0.0-rc9.0.20200122160610-2fc03cc11c77 or later.
What is the CVSS score of CVE-2019-19921?
CVE-2019-19921 has a CVSS v3.1 base score of 5.9 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N/E:U/RL:U/RC:U.
What CWE is associated with CVE-2019-19921?
CVE-2019-19921 is classified under CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition') (The product contains a concurrent code sequence that requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence operating concurrently.).
How can I check Go dependencies for CVE-2019-19921?
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-fh74-hm69-rqjw",
  "modified" : "2024-05-31T17:08:04Z",
  "published" : "2021-05-27T18:41:17Z",
  "aliases" : [ "CVE-2019-19921" ],
  "summary" : "opencontainers runc contains procfs race condition with a shared volume mount",
  "details" : "### Impact\nBy crafting a malicious root filesystem (with `/proc` being a symlink to a directory which was inside a volume shared with another running container), an attacker in control of both containers can trick `runc` into not correctly configuring the container's security labels and not correctly masking paths inside `/proc` which contain potentially-sensitive information about the host (or even allow for direct attacks against the host).\n\nIn order to exploit this bug, an untrusted user must be able to spawn custom containers with custom mount configurations (such that a volume is shared between two containers). It should be noted that we consider this to be a fairly high level of access for an untrusted user -- and we do not recommend allowing completely untrusted users to have such degrees of access without further restrictions.\n\n### Specific Go Package Affected\ngithub.com/opencontainers/runc/libcontainer\n\n### Patches\nThis vulnerability has been fixed in `1.0.0-rc10`. It should be noted that the current fix is effectively a hot-fix, and there are known ways for it to be worked around (such as making the entire root filesystem a shared volume controlled by another container). We recommend that users review their access policies to ensure that untrusted users do not have such high levels of controls over container mount configuration.\n\n### Workarounds\nIf you are not providing the ability for untrusted users to configure mountpoints for `runc` (or through a higher-level tool such as `docker run -v`) then you are not vulnerable to this issue. This exploit requires fairly complicated levels of access (which are available for some public clouds but are not necessarily available for all deployments).\n\nAdditionally, it appears as though it is not possible to exploit this vulnerability through Docker (due to the order of mounts Docker generates). However you should not depend on this, as it may be possible to work around this roadblock.\n\n### Credits\nThis vulnerability was discovered by Cure53, as part of a third-party security audit.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* [Open an issue](https://github.com/opencontainers/runc/issues/new).\n* Email us at [dev@opencontainers.org](mailto:dev@opencontainers.org), or [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:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N/E:U/RL:U/RC:U"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/opencontainers/runc"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.0.0-rc9.0.20200122160610-2fc03cc11c77"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/opencontainers/runc/security/advisories/GHSA-fh74-hm69-rqjw"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2019-19921"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/opencontainers/runc/issues/2197"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/opencontainers/runc/pull/2190"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/opencontainers/runc/pull/2207"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/opencontainers/runc/commit/2fc03cc11c775b7a8b2e48d7ee447cb9bef32ad0"
  }, {
    "type" : "WEB",
    "url" : "https://usn.ubuntu.com/4297-1"
  }, {
    "type" : "WEB",
    "url" : "https://security.gentoo.org/glsa/202003-21"
  }, {
    "type" : "WEB",
    "url" : "https://security-tracker.debian.org/tracker/CVE-2019-19921"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2021-0087"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/I6BF24VCZRFTYBTT3T7HDZUOTKOTNPLZ"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/FYVE3GB4OG3BNT5DLQHYO4M5SXX33AQ5"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/FNB2UEDIIJCRQW4WJLZOPQJZXCVSXMLD"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/DHGVGGMKGZSJ7YO67TGGPFEHBYMS63VF"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ANUGDBJ7NBUMSUFZUSKU3ZMQYZ2Z3STN"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2023/03/msg00023.html"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/opencontainers/runc/releases"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2020:0695"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2020:0688"
  }, {
    "type" : "WEB",
    "url" : "http://lists.opensuse.org/opensuse-security-announce/2020-02/msg00018.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-362", "CWE-706" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-05-24T21:20:41Z",
    "nvd_published_at" : "2020-02-12T15:15:00Z"
  }
}