CVE-2021-41190: Clarify Content-Type handling in OCI spec
In the OCI Distribution Specification version 1.0.0 and prior and in the OCI Image Specification version 1.0.1 and prior, manifest and index documents are ambiguous without an accompanying Content-Type HTTP header. Versions of Moby (Docker Engine) prior to 20.10.11 treat the Content-Type header as trusted and deserialize the document according to that header. If the Content-Type header changed between pulls of the same ambiguous document (with the same digest), the document may be interpreted differently, meaning that the digest alone is insufficient to unambiguously identify the content of the image.
References:
https://github.com/moby/moby/security/advisories/GHSA-xmmx-7jpf-fx42 https://github.com/opencontainers/distribution-spec/security/advisories/GHSA-mc8v-mgrf-8f4m https://github.com/opencontainers/image-spec/security/advisories/GHSA-77vh-xpmg-72qh https://github.com/containerd/containerd/releases/tag/v1.4.12 https://github.com/containerd/containerd/releases/tag/v1.5.8 https://github.com/moby/moby/releases/tag/v20.10.11 https://github.com/containerd/containerd/security/advisories/GHSA-5j5w-g665-5m35
Other sources
The OCI Distribution Spec project defines an API protocol to facilitate and standardize the distribution of content. In the OCI Distribution Specification version 1.0.0 and prior, the Content-Type header alone was used to determine the type of document during push and pull operations. Documents that contain both “manifests” and “layers” fields could be interpreted as either a manifest or an index in the absence of an accompanying Content-Type header. If a Content-Type header changed between two pulls of the same digest, a client may interpret the resulting content differently. The OCI Distribution Specification has been updated to require that a mediaType value present in a manifest or index match the Content-Type header used during the push and pull operations. Clients pulling from a registry may distrust the Content-Type header and reject an ambiguous document that contains both “manifests” and “layers” fields or “manifests” and “config” fields if they are unable to update to version 1.0.1 of the spec.
The OCI Distribution Spec project defines an API protocol to facilitate and standardize the distribution of content. In the OCI Image Specification, the manifest and index documents were not self-describing and documents with a single digest could be interpreted as either a manifest or an index. In the OCI Image Specification version 1.0.1 there is specified a recommendation that both manifest and index documents contain a mediaType field to identify the type of document.
Affected Software
Remediation
Event History
Parent advisories
This vulnerability appears in the following advisories.
Frequently Asked Questions
What is the severity of CVE-2021-41190?
CVE-2021-41190 has a medium severity rating due to the ambiguity in manifest and index documents.
How do I fix CVE-2021-41190?
To fix CVE-2021-41190, upgrade to cri-o version 0:1.23.0-92.rhaos4.10.gitdaab4d1.el7 or opencontainers/image-spec version 1.0.1.
What are the affected versions for CVE-2021-41190?
CVE-2021-41190 affects OCI Distribution Specification versions 1.0.0 and prior, and OCI Image Specification versions 1.0.1 and prior.
Which software packages are vulnerable to CVE-2021-41190?
The vulnerable software includes cri-o versions prior to 0:1.23.0 and opencontainers/image-spec versions prior to 1.0.1.
Is CVE-2021-41190 specific to a certain operating system?
CVE-2021-41190 affects various Linux distributions, including specific versions of Fedora.