GHSA-qq97-vm5h-rrhg: Github.com/docker/distribution OCI Manifest Type Confusion Issue Vulnerability

LOW
CVSS 3.0
CWE-843
Published
Advisory Summary

GHSA-qq97-vm5h-rrhg is a LOW (CVSS 3.0) oci manifest type confusion issue vulnerability (CWE-843: Access of Resource Using Incompatible Type ('Type Confusion')) affecting Github.com/docker/distribution libraries in the Go ecosystem. The issue involves oci manifest type confusion issue. Remediation is available by upgrading affected packages to version 2.8.0.

GHSA-qq97-vm5h-rrhg at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-qq97-vm5h-rrhg
Severity LOW
CVSS v3.1 Base Score 3.0
CWE Classification CWE-843: Access of Resource Using Incompatible Type ('Type Confusion')
Affected Product Github.com/docker/distribution
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 3.0

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

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

How to Fix GHSA-qq97-vm5h-rrhg

To remediate this vulnerability, upgrade all affected Github.com/docker/distribution 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/docker/distribution fixed: 2.8.0
Upgrade github.com/docker/distribution to 2.8.0
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/docker/distribution

How to Check if You Are Affected

To determine whether your application is affected by GHSA-qq97-vm5h-rrhg, inspect your project dependencies for Github.com/docker/distribution:

inspect dependencies for github.com/docker/distribution

Analyze the terminal output to locate any version of Github.com/docker/distribution in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.8.0), 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-843: Access of Resource Using Incompatible Type ('Type Confusion'), where the product allocates or initializes a resource such as a pointer, object, or variable using one type, but it later accesses that resource using a type that is incompatible with the original type. In Github.com/docker/distribution, 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 Systems that rely on digest equivalence for image attestations may be vulnerable to type confusion. ### Patches Upgrade to at least `v2.8.0-beta.1` if you are running `v2.x` release. If you use the code from the `main` branch, update at least to the commit after [b59a6f827947f9e0e67df0cfb571046de4733586](https://github.com/distribution/distribution/commit/b59a6f827947f9e0e67df0cfb571046de4733586). ### Workarounds There is no way to work around this issue without patching. ### References Due to [an oversight in the OCI Image Specification](https://github.com/opencontainers/image-spec/pull/411) that removed the embedded `mediaType` field from manifests, a maliciously crafted OCI Container Image can cause registry clients to parse the same image in two different ways without modifying the image’s digest by modifying the `Content-Type` header returned by a registry. This can invalidate a common pattern of relying on container image digests for equivalence. ### For more information If you have any questions or comments about this advisory: * Open an issue in [distribution](https://github.com/distribution/distribution) * Open an issue in [distribution-spec](https://github.com/opencontainers/distribution-spec) * Email us at [cncf-distribution-security@lists.cncf.io](mailto:cncf-distribution-security@lists.cncf.io)

GHSA-qq97-vm5h-rrhg Affected Github.com/docker/distribution Versions

1 component(s)
Fixed Versions:
2.8.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/docker/distribution
Go
< 2.8.0
2.8.0

References

Frequently Asked Questions

What is GHSA-qq97-vm5h-rrhg?
GHSA-qq97-vm5h-rrhg is a security vulnerability in Github.com/docker/distribution involving OCI Manifest Type Confusion Issue under CWE-843: Access of Resource Using Incompatible Type ('Type Confusion').
Which Github.com/docker/distribution versions are affected?
Affected versions include releases prior to 2.8.0 across affected packages: github.com/docker/distribution.
What version fixes GHSA-qq97-vm5h-rrhg?
Upgrading to 2.8.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/docker/distribution affected?
Yes, github.com/docker/distribution is affected in releases prior to 2.8.0. Upgrade your dependency to 2.8.0 or later.
What is the CVSS score of GHSA-qq97-vm5h-rrhg?
GHSA-qq97-vm5h-rrhg has a CVSS v3.1 base score of 3.0 (LOW) with vector string CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:N/I:L/A:N.
What CWE is associated with GHSA-qq97-vm5h-rrhg?
GHSA-qq97-vm5h-rrhg is classified under CWE-843: Access of Resource Using Incompatible Type ('Type Confusion') (The product allocates or initializes a resource such as a pointer, object, or variable using one type, but it later accesses that resource using a type that is incompatible with the original type.).
How can I check Go dependencies for GHSA-qq97-vm5h-rrhg?
Run the dependency tree command: 'inspect dependencies for github.com/docker/distribution'. 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-qq97-vm5h-rrhg",
  "modified" : "2023-02-09T15:29:32Z",
  "published" : "2022-02-08T18:53:56Z",
  "aliases" : [ ],
  "summary" : "OCI Manifest Type Confusion Issue",
  "details" : "### Impact\n\nSystems that rely on digest equivalence for image attestations may be vulnerable to type confusion.\n\n### Patches\n\nUpgrade to at least `v2.8.0-beta.1`  if you are running `v2.x` release. If you use the code from the `main` branch, update at least to the commit after [b59a6f827947f9e0e67df0cfb571046de4733586](https://github.com/distribution/distribution/commit/b59a6f827947f9e0e67df0cfb571046de4733586).\n\n### Workarounds\n\nThere is no way to work around this issue without patching.\n\n### References\n\nDue to [an oversight in the OCI Image Specification](https://github.com/opencontainers/image-spec/pull/411) that removed the embedded `mediaType` field from manifests, a maliciously crafted OCI Container Image can cause registry clients to parse the same image in two different ways without modifying the image’s digest by modifying the `Content-Type` header returned by a registry. This can invalidate a common pattern of relying on container image digests for equivalence.\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n* Open an issue in [distribution](https://github.com/distribution/distribution) \n* Open an issue in [distribution-spec](https://github.com/opencontainers/distribution-spec) \n* Email us at [cncf-distribution-security@lists.cncf.io](mailto:cncf-distribution-security@lists.cncf.io)\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:N/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/docker/distribution"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.8.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/distribution/distribution/security/advisories/GHSA-qq97-vm5h-rrhg"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/opencontainers/image-spec/pull/411"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/distribution/distribution/commit/b59a6f827947f9e0e67df0cfb571046de4733586"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/distribution/distribution"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2022-0379"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-843" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-02-08T18:53:56Z",
    "nvd_published_at" : null
  }
}