CVE-2021-20291: Improper Locking in github.com/containers/storage
Summary
CVE-2021-20291: Denial of service via deadlock in github.com/containers/storage. Affects github.com/containers/storage versions < 1.28.1. Fixed in 1.28.1. How to fix ↓
Also tracked for
- golang-github-containers-storage · Debian:11
The same CVE-2021-20291 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The github.com/containers/storage package is a Go package that is used for managing container storage. It provides functionality for unpacking container images and storing them. This package is commonly used by applications that utilize containerization technology. The package is vulnerable to a deadlock vulnerability in versions before 1.28.1.
Vulnerability Detail
A deadlock vulnerability was discovered in github.com/containers/storage before version 1.28.1. When processing a container image, each layer is unpacked using tar. If one of the layers is not a valid tar archive, an error occurs and the code enters an unexpected situation where it indefinitely waits for the tar unpacked stream, which never finishes. An attacker can exploit this vulnerability by crafting a malicious image. When this image is downloaded and stored by an application using github.com/containers/storage, it triggers a deadlock, resulting in a Denial of Service (DoS) attack.
How To Fix
Latest published version: v1.59.1 as of 22 Oct 2026
go get github.com/containers/storage@v1.59.1
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
1.28.1
This is the first release that contains the fix.
go get github.com/containers/storage@v1.28.1
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
There is no known workaround for this vulnerability. It is necessary to update the package to the fixed version.
Conclusion
The github.com/containers/storage package is vulnerable to a deadlock vulnerability that can be exploited to cause a Denial of Service (DoS) attack. It is recommended to update the package to version 1.28.1 or later to fix this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for github.com/containers/storage →
FAQ
This vulnerability can be exploited by an attacker to cause a Denial of Service (DoS) attack by crafting a malicious container image.
You can use the Vulert Playground at Vulert Scanner to check if your application is affected by this vulnerability. Simply provide your Gopkg.lock file and the playground will analyze it for vulnerabilities.
There are currently no known exploits for this vulnerability.
Yes, the CVSS score for this vulnerability is 6.5.
Yes, the fix for this vulnerability is included in version 1.28.1 of the github.com/containers/storage package.