CVE-2020-15257: Github.com/containerd/containerd Containerd-shim API Exposed To Host Vulnerability

MODERATE
Advisory Identifier: GHSA-36xw-fx78-c5r4
CVSS 5.2
CWE-669
Published
Advisory Summary

CVE-2020-15257 is a MODERATE (CVSS 5.2) containerd-shim api exposed to host vulnerability (CWE-669: Incorrect Resource Transfer Between Spheres) affecting Github.com/containerd/containerd libraries in the Go ecosystem. The issue involves containerd-shim api exposed to host network containers. Remediation is available by upgrading affected packages to version 1.3.9, 1.4.3.

CVE-2020-15257 at a Glance

CVE Identifier CVE-2020-15257
GHSA Identifier GHSA-36xw-fx78-c5r4
Severity MODERATE
CVSS v3.1 Base Score 5.2
CWE Classification CWE-669: Incorrect Resource Transfer Between Spheres
Affected Product Github.com/containerd/containerd
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.2

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

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

How to Fix CVE-2020-15257

To remediate this vulnerability, upgrade all affected Github.com/containerd/containerd 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/containerd/containerd fixed: 1.3.9
Upgrade github.com/containerd/containerd to 1.3.9
github.com/containerd/containerd fixed: 1.4.3
Upgrade github.com/containerd/containerd to 1.4.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/containerd/containerd

How to Check if You Are Affected

To determine whether your application is affected by CVE-2020-15257, inspect your project dependencies for Github.com/containerd/containerd:

inspect dependencies for github.com/containerd/containerd

Analyze the terminal output to locate any version of Github.com/containerd/containerd in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.3.9), 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-669: Incorrect Resource Transfer Between Spheres, where the product does not properly transfer a resource/behavior to another sphere, or improperly imports a resource/behavior from another sphere, in a manner that provides unintended control over that resource. In Github.com/containerd/containerd, 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 Access controls for the shim’s API socket verified that the connecting process had an effective UID of 0, but did not otherwise restrict access to the abstract Unix domain socket. This would allow malicious containers running in the same network namespace as the shim, with an effective UID of 0 but otherwise reduced privileges, to cause new processes to be run with elevated privileges. ### Specific Go Packages Affected github.com/containerd/containerd/cmd ## Patches This vulnerability has been fixed in containerd 1.3.9 and 1.4.3. Users should update to these versions as soon as they are released. It should be noted that containers started with an old version of containerd-shim should be stopped and restarted, as running containers will continue to be vulnerable even after an upgrade. ## Workarounds If you are not providing the ability for untrusted users to start containers in the same network namespace as the shim (typically the "host" network namespace, for example with `docker run --net=host` or `hostNetwork: true` in a Kubernetes pod) and run with an effective UID of 0, you are not vulnerable to this issue. If you are running containers with a vulnerable configuration, you can deny access to all abstract sockets with AppArmor by adding a line similar to `deny unix addr=@**,` to your policy. It is best practice to run containers with a reduced set of privileges, with a non-zero UID, and with isolated namespaces. The containerd maintainers strongly advise against sharing namespaces with the host. Reducing the set of isolation mechanisms used for a container necessarily increases that container's privilege, regardless of what container runtime is used for running that container. ## Credits The containerd maintainers would like to thank Jeff Dileo of NCC Group for responsibly disclosing this issue in accordance with the [containerd security policy](https://github.com/containerd/project/blob/master/SECURITY.md) and for reviewing the patch. ## For more information If you have any questions or comments about this advisory: * [Open an issue](https://github.com/containerd/containerd/issues/new/choose) * Email us at security@containerd.io if you think you’ve found a security bug.

CVE-2020-15257 Affected Github.com/containerd/containerd Versions

2 component(s)
Fixed Versions:
1.3.91.4.3
Product / Package Ecosystem Affected Versions Fixed Version
github.com/containerd/containerd
Go
< 1.3.9
1.3.9
github.com/containerd/containerd
Go
≥ 1.4.0
< 1.4.3
1.4.3

References

Frequently Asked Questions

What is CVE-2020-15257?
CVE-2020-15257 is a security vulnerability in Github.com/containerd/containerd involving containerd-shim API Exposed to Host Network Containers under CWE-669: Incorrect Resource Transfer Between Spheres.
Which Github.com/containerd/containerd versions are affected?
Affected versions include releases prior to 1.3.9, 1.4.3 across affected packages: github.com/containerd/containerd.
What version fixes CVE-2020-15257?
Upgrading to 1.3.9, 1.4.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/containerd/containerd affected?
Yes, github.com/containerd/containerd is affected in releases prior to 1.3.9, 1.4.3. Upgrade your dependency to 1.3.9, 1.4.3 or later.
What is the CVSS score of CVE-2020-15257?
CVE-2020-15257 has a CVSS v3.1 base score of 5.2 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2020-15257?
CVE-2020-15257 is classified under CWE-669: Incorrect Resource Transfer Between Spheres (The product does not properly transfer a resource/behavior to another sphere, or improperly imports a resource/behavior from another sphere, in a manner that provides unintended control over that resource.).
How can I check Go dependencies for CVE-2020-15257?
Run the dependency tree command: 'inspect dependencies for github.com/containerd/containerd'. 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-36xw-fx78-c5r4",
  "modified" : "2023-10-02T15:37:35Z",
  "published" : "2021-05-24T17:00:22Z",
  "aliases" : [ "CVE-2020-15257" ],
  "summary" : "containerd-shim API Exposed to Host Network Containers",
  "details" : "## Impact\n\nAccess controls for the shim’s API socket verified that the connecting process had an effective UID of 0, but did not otherwise restrict access to the abstract Unix domain socket. This would allow malicious containers running in the same network namespace as the shim, with an effective UID of 0 but otherwise reduced privileges, to cause new processes to be run with elevated privileges.\n\n### Specific Go Packages Affected\ngithub.com/containerd/containerd/cmd\n\n## Patches\n\nThis vulnerability has been fixed in containerd 1.3.9 and 1.4.3.  Users should update to these versions as soon as they are released.  It should be noted that containers started with an old version of containerd-shim should be stopped and restarted, as running containers will continue to be vulnerable even after an upgrade.\n\n## Workarounds\n\nIf you are not providing the ability for untrusted users to start containers in the same network namespace as the shim (typically the \"host\" network namespace, for example with `docker run --net=host` or `hostNetwork: true` in a Kubernetes pod) and run with an effective UID of 0, you are not vulnerable to this issue.\n\nIf you are running containers with a vulnerable configuration, you can deny access to all abstract sockets with AppArmor by adding a line similar to `deny unix addr=@**,` to your policy.\n\nIt is best practice to run containers with a reduced set of privileges, with a non-zero UID, and with isolated namespaces.  The containerd maintainers strongly advise against sharing namespaces with the host. Reducing the set of isolation mechanisms used for a container necessarily increases that container's privilege, regardless of what container runtime is used for running that container.\n\n## Credits\n\nThe containerd maintainers would like to thank Jeff Dileo of NCC Group for responsibly disclosing this issue in accordance with the [containerd security policy](https://github.com/containerd/project/blob/master/SECURITY.md) and for reviewing the patch.\n\n## For more information\n\nIf you have any questions or comments about this advisory:\n\n\n* [Open an issue](https://github.com/containerd/containerd/issues/new/choose)\n* Email us at security@containerd.io if you think you’ve found a security bug.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/containerd/containerd"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.3.9"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/containerd/containerd"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.4.0"
      }, {
        "fixed" : "1.4.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/containerd/containerd/security/advisories/GHSA-36xw-fx78-c5r4"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-15257"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/containerd/containerd/commit/4a4bb851f5da563ff6e68a83dc837c7699c469ad"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/containerd/containerd/releases/tag/v1.4.3"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/LNKXLOLZWO5FMAPX63ZL7JNKTNNT5NQD"
  }, {
    "type" : "WEB",
    "url" : "https://research.nccgroup.com/2020/12/10/abstract-shimmer-cve-2020-15257-host-networking-is-root-equivalent-again"
  }, {
    "type" : "WEB",
    "url" : "https://security.gentoo.org/glsa/202105-33"
  }, {
    "type" : "WEB",
    "url" : "https://www.debian.org/security/2021/dsa-4865"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-669" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-05-21T22:13:21Z",
    "nvd_published_at" : "2020-12-01T03:15:00Z"
  }
}