CVE-2021-20291: Improper Locking in github.com/containers/storage
Summary
CVE-2021-20291: Improper Locking 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 package under scrutiny is github.com/containers/storage, which is written in Go. It is responsible for managing container images and their storage. The package provides functionality for unpacking container image layers using the tar format. This vulnerability affects versions prior to 1.28.1 of the package.
Vulnerability Detail
A deadlock vulnerability was discovered in github.com/containers/storage. 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 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. Updating the package to the fixed version is the recommended solution.
Conclusion
In conclusion, the github.com/containers/storage package prior to version 1.28.1 is vulnerable to a deadlock issue that can be exploited to cause a Denial of Service (DoS) attack. It is crucial to update the package to the fixed version to mitigate this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for github.com/containers/storage →
FAQ
This vulnerability allows an attacker to trigger a deadlock in applications using containers/storage, leading to a Denial of Service (DoS) attack.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability. Simply provide your Gopkg.lock file to the playground, and it will alert you in real-time if the vulnerability is present.
Yes, updating the github.com/containers/storage package to version 1.28.1 or later fixes this vulnerability.
No, there are no known workarounds for this vulnerability. Updating the package is the recommended solution.
The severity of this vulnerability is moderate, with a CVSS score of 6.5.