CVE-2021-20291: Github.com/containers/storage Improper Locking Vulnerability
MODERATECVE-2021-20291 is a MODERATE (CVSS 6.5) improper locking vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Github.com/containers/storage libraries in the Go ecosystem. The issue involves improper locking in github.com/containers/storage. Remediation is available by upgrading affected packages to version 1.28.1.
CVE-2021-20291 at a Glance
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).
How to Fix CVE-2021-20291
To remediate this vulnerability, upgrade all affected Github.com/containers/storage dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/containers/storage to 1.28.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/containers/storage
How to Check if You Are Affected
To determine whether your application is affected by CVE-2021-20291, inspect your project dependencies for Github.com/containers/storage:
inspect dependencies for github.com/containers/storage
Analyze the terminal output to locate any version of Github.com/containers/storage in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.28.1), 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/containers/storage, 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
CVE-2021-20291 Affected Github.com/containers/storage Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/containers/storage
|
Go |
< 1.28.1
|
1.28.1
|
References
Frequently Asked Questions
What is CVE-2021-20291?
Which Github.com/containers/storage versions are affected?
What version fixes CVE-2021-20291?
Is github.com/containers/storage affected?
What is the CVSS score of CVE-2021-20291?
What CWE is associated with CVE-2021-20291?
How can I check Go dependencies for CVE-2021-20291?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-7qw8-847f-pggm",
"modified" : "2023-02-14T17:41:32Z",
"published" : "2021-05-10T19:35:07Z",
"aliases" : [ "CVE-2021-20291" ],
"summary" : "Improper Locking in github.com/containers/storage",
"details" : "A deadlock vulnerability was found in `github.com/containers/storage` in versions before 1.28.1. When a container image is processed, each layer is unpacked using `tar`. If one of those layers is not a valid `tar` archive this causes an error leading to an unexpected situation where the code indefinitely waits for the tar unpacked stream, which never finishes. An attacker could use this vulnerability to craft a malicious image, which when downloaded and stored by an application using containers/storage, would then cause a deadlock leading to a Denial of Service (DoS).",
"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/containers/storage"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.28.1"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-20291"
}, {
"type" : "WEB",
"url" : "https://github.com/containers/storage/pull/860"
}, {
"type" : "WEB",
"url" : "https://github.com/containers/storage/commit/306fcabc964470e4b3b87a43a8f6b7d698209ee1"
}, {
"type" : "WEB",
"url" : "https://bugzilla.redhat.com/show_bug.cgi?id=1939485"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/containers/storage"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/R5D7XL7FL24TWFMGQ3K2S72EOUSLZMKL"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/SPYOHNG2Q7DCAQZMGYLMENLKALGDLG3X"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/WX24EITRXVHDM5M223BVTJA2ODF2FSHI"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ZNMB7O2UIXE34PGSCSOULGHPX5LIJBMM"
}, {
"type" : "WEB",
"url" : "https://pkg.go.dev/vuln/GO-2021-0100"
}, {
"type" : "WEB",
"url" : "https://unit42.paloaltonetworks.com/cve-2021-20291"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-400", "CWE-667" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2021-05-04T19:15:55Z",
"nvd_published_at" : "2021-04-01T18:15:00Z"
}
}