CVE-2021-21285: Github.com/moby/moby Moby Docker Daemon Crash During Vulnerability

MODERATE
Advisory Identifier: GHSA-6fj5-m822-rqx8
CVSS 6.5
CWE-400 CWE-754
Published
Advisory Summary

CVE-2021-21285 is a MODERATE (CVSS 6.5) moby docker daemon crash during vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Github.com/moby/moby libraries in the Go ecosystem. The issue involves moby docker daemon crash during image pull of malicious image. Remediation is available by upgrading affected packages to version 19.3.15, 20.10.3.

CVE-2021-21285 at a Glance

CVE Identifier CVE-2021-21285
GHSA Identifier GHSA-6fj5-m822-rqx8
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Github.com/moby/moby
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.5

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

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

How to Fix CVE-2021-21285

To remediate this vulnerability, upgrade all affected Github.com/moby/moby 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/moby/moby fixed: 19.3.15
Upgrade github.com/moby/moby to 19.3.15
github.com/moby/moby fixed: 20.10.3
Upgrade github.com/moby/moby to 20.10.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/moby/moby

How to Check if You Are Affected

To determine whether your application is affected by CVE-2021-21285, inspect your project dependencies for Github.com/moby/moby:

inspect dependencies for github.com/moby/moby

Analyze the terminal output to locate any version of Github.com/moby/moby in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 19.3.15), 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-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Github.com/moby/moby, 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 Pulling an intentionally malformed Docker image manifest crashes the `dockerd` daemon. ### Patches Versions 20.10.3 and 19.03.15 contain patches that prevent the daemon from crashing. ### Credits Maintainers would like to thank Josh Larsen, Ian Coldwater, Duffie Cooley, Rory McCune for working on the vulnerability and Brad Geesaman for responsibly disclosing it to security@docker.com.

CVE-2021-21285 Affected Github.com/moby/moby Versions

2 component(s)
Fixed Versions:
19.3.1520.10.3
Product / Package Ecosystem Affected Versions Fixed Version
github.com/moby/moby
Go
< 19.3.15
19.3.15
github.com/moby/moby
Go
≥ 20.10.0-beta1
< 20.10.3
20.10.3

References

Frequently Asked Questions

What is CVE-2021-21285?
CVE-2021-21285 is a security vulnerability in Github.com/moby/moby involving moby docker daemon crash during image pull of malicious image under CWE-400: Uncontrolled Resource Consumption.
Which Github.com/moby/moby versions are affected?
Affected versions include releases prior to 19.3.15, 20.10.3 across affected packages: github.com/moby/moby.
What version fixes CVE-2021-21285?
Upgrading to 19.3.15, 20.10.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/moby/moby affected?
Yes, github.com/moby/moby is affected in releases prior to 19.3.15, 20.10.3. Upgrade your dependency to 19.3.15, 20.10.3 or later.
What is the CVSS score of CVE-2021-21285?
CVE-2021-21285 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2021-21285?
CVE-2021-21285 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check Go dependencies for CVE-2021-21285?
Run the dependency tree command: 'inspect dependencies for github.com/moby/moby'. 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-6fj5-m822-rqx8",
  "modified" : "2024-06-10T18:39:20Z",
  "published" : "2024-01-31T23:16:46Z",
  "aliases" : [ "CVE-2021-21285" ],
  "summary" : "moby docker daemon crash during image pull of malicious image",
  "details" : "### Impact\n\nPulling an intentionally malformed Docker image manifest crashes the `dockerd` daemon.\n\n### Patches\n\nVersions 20.10.3 and 19.03.15 contain patches that prevent the daemon from crashing.\n\n### Credits\n\nMaintainers would like to thank Josh Larsen, Ian Coldwater, Duffie Cooley, Rory McCune for working on the vulnerability and Brad Geesaman for responsibly disclosing it to security@docker.com.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/moby/moby"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "19.3.15"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/moby/moby"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "20.10.0-beta1"
      }, {
        "fixed" : "20.10.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/moby/moby/security/advisories/GHSA-6fj5-m822-rqx8"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-21285"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/moby/moby/commit/8d3179546e79065adefa67cc697c09d0ab137d30"
  }, {
    "type" : "WEB",
    "url" : "https://docs.docker.com/engine/release-notes/#20103"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/moby/moby/releases/tag/v19.03.15"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/moby/moby/releases/tag/v20.10.3"
  }, {
    "type" : "WEB",
    "url" : "https://security.gentoo.org/glsa/202107-23"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20210226-0005"
  }, {
    "type" : "WEB",
    "url" : "https://www.debian.org/security/2021/dsa-4865"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400", "CWE-754" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-01-31T23:16:46Z",
    "nvd_published_at" : "2021-02-02T18:15:00Z"
  }
}