CVE-2021-41103: Github.com/containerd/containerd Insufficiently Restricted Permissions On Plugin Vulnerability

MODERATE
Advisory Identifier: GHSA-c2h3-6mxw-7mvq
CVSS 5.9
CWE-22
Published
Advisory Summary

CVE-2021-41103 is a MODERATE (CVSS 5.9) insufficiently restricted permissions on plugin vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Github.com/containerd/containerd libraries in the Go ecosystem. The issue involves insufficiently restricted permissions on plugin directories. Remediation is available by upgrading affected packages to version 1.4.11, 1.5.7.

CVE-2021-41103 at a Glance

CVE Identifier CVE-2021-41103
GHSA Identifier GHSA-c2h3-6mxw-7mvq
Severity MODERATE
CVSS v3.1 Base Score 5.9
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Github.com/containerd/containerd
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.0/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-2021-41103

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.4.11
Upgrade github.com/containerd/containerd to 1.4.11
github.com/containerd/containerd fixed: 1.5.7
Upgrade github.com/containerd/containerd to 1.5.7
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-2021-41103, 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.4.11), 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-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. 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 A bug was found in containerd where container root directories and some plugins had insufficiently restricted permissions, allowing otherwise unprivileged Linux users to traverse directory contents and execute programs. When containers included executable programs with extended permission bits (such as setuid), unprivileged Linux users could discover and execute those programs. When the UID of an unprivileged Linux user on the host collided with the file owner or group inside a container, the unprivileged Linux user on the host could discover, read, and modify those files. ### Patches This vulnerability has been fixed in containerd 1.4.11 and containerd 1.5.7. Users should update to these version when they are released and may restart containers or update directory permissions to mitigate the vulnerability. ### Workarounds Limit access to the host to trusted users. Update directory permission on container bundles directories. ### For more information If you have any questions or comments about this advisory: * Open an issue in [github.com/containerd/containerd](https://github.com/containerd/containerd/issues/new/choose) * Email us at [security@containerd.io](mailto:security@containerd.io)

CVE-2021-41103 Affected Github.com/containerd/containerd Versions

2 component(s)
Fixed Versions:
1.4.111.5.7
Product / Package Ecosystem Affected Versions Fixed Version
github.com/containerd/containerd
Go
< 1.4.11
1.4.11
github.com/containerd/containerd
Go
≥ 1.5.0
< 1.5.7
1.5.7

References

GitHub Advisory / Wiki ADVISORY
https://github.com/containerd/containerd/security/advisories/GHSA-c2h3-6mxw-7mvq
NVD — CVE-2021-41103 NVD
https://nvd.nist.gov/vuln/detail/CVE-2021-41103
Security Fix Commit FIX COMMIT
https://github.com/containerd/containerd/commit/5b46e404f6b9f661a205e28d59c982d3634148f8
cert-portal.siemens.com/productcert/pdf/ssa... WEB
https://cert-portal.siemens.com/productcert/pdf/ssa-222547.pdf
Github.com/containerd/containerd Source Repository REPOSITORY
https://github.com/containerd/containerd
Github.com/containerd/containerd Release RELEASE
https://github.com/containerd/containerd/releases/tag/v1.4.11
Github.com/containerd/containerd Release RELEASE
https://github.com/containerd/containerd/releases/tag/v1.5.7
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/B5Q6G6I4W5COQE25QMC7FJY3I3PAYFBB
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ZNFADTCHHYWVM6W4NJ6CB4FNFM2VMBIB
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/B5Q6G6I4W5COQE25QMC7FJY3I3PAYFBB
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ZNFADTCHHYWVM6W4NJ6CB4FNFM2VMBIB
Github.com/containerd/containerd Security Information SECURITY
https://security.gentoo.org/glsa/202401-31
Github.com/containerd/containerd Security Information SECURITY
https://www.debian.org/security/2021/dsa-5002

Frequently Asked Questions

What is CVE-2021-41103?
CVE-2021-41103 is a security vulnerability in Github.com/containerd/containerd involving Insufficiently restricted permissions on plugin directories under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Github.com/containerd/containerd versions are affected?
Affected versions include releases prior to 1.4.11, 1.5.7 across affected packages: github.com/containerd/containerd.
What version fixes CVE-2021-41103?
Upgrading to 1.4.11, 1.5.7 (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.4.11, 1.5.7. Upgrade your dependency to 1.4.11, 1.5.7 or later.
What is the CVSS score of CVE-2021-41103?
CVE-2021-41103 has a CVSS v3.1 base score of 5.9 (MODERATE) with vector string CVSS:3.0/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L.
What CWE is associated with CVE-2021-41103?
CVE-2021-41103 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check Go dependencies for CVE-2021-41103?
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-c2h3-6mxw-7mvq",
  "modified" : "2021-10-15T17:31:03Z",
  "published" : "2021-10-04T20:14:47Z",
  "aliases" : [ "CVE-2021-41103" ],
  "summary" : "Insufficiently restricted permissions on plugin directories",
  "details" : "### Impact\nA bug was found in containerd where container root directories and some plugins had insufficiently restricted permissions, allowing otherwise unprivileged Linux users to traverse directory contents and execute programs. When containers included executable programs with extended permission bits (such as setuid), unprivileged Linux users could discover and execute those programs. When the UID of an unprivileged Linux user on the host collided with the file owner or group inside a container, the unprivileged Linux user on the host could discover, read, and modify those files.\n\n### Patches\nThis vulnerability has been fixed in containerd 1.4.11 and containerd 1.5.7. Users should update to these version when they are released and may restart containers or update directory permissions to mitigate the vulnerability.\n\n### Workarounds\nLimit access to the host to trusted users. Update directory permission on container bundles directories. \n\n### For more information\nIf you have any questions or comments about this advisory: \n* Open an issue in [github.com/containerd/containerd](https://github.com/containerd/containerd/issues/new/choose)\n* Email us at [security@containerd.io](mailto:security@containerd.io)\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/containerd/containerd"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.4.11"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/containerd/containerd"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.5.0"
      }, {
        "fixed" : "1.5.7"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/containerd/containerd/security/advisories/GHSA-c2h3-6mxw-7mvq"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-41103"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/containerd/containerd/commit/5b46e404f6b9f661a205e28d59c982d3634148f8"
  }, {
    "type" : "WEB",
    "url" : "https://cert-portal.siemens.com/productcert/pdf/ssa-222547.pdf"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/containerd/containerd"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/containerd/containerd/releases/tag/v1.4.11"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/containerd/containerd/releases/tag/v1.5.7"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/B5Q6G6I4W5COQE25QMC7FJY3I3PAYFBB"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ZNFADTCHHYWVM6W4NJ6CB4FNFM2VMBIB"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/B5Q6G6I4W5COQE25QMC7FJY3I3PAYFBB"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ZNFADTCHHYWVM6W4NJ6CB4FNFM2VMBIB"
  }, {
    "type" : "WEB",
    "url" : "https://security.gentoo.org/glsa/202401-31"
  }, {
    "type" : "WEB",
    "url" : "https://www.debian.org/security/2021/dsa-5002"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-10-04T17:05:03Z",
    "nvd_published_at" : "2021-10-04T17:15:00Z"
  }
}