Deadlock Vulnerability in golang-github-containers-storage: Denial of Service Risk
Summary
CVE-2021-20291: A deadlock vulnerability was found in 'github.com/containers/storage' in versions before 1.28.1. Affects golang-github-containers-storage versions < 1377cdd4aa19150f967f54a727cc1d5ac8c2003f. No fix is published. How to fix ↓
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 golang-github-containers-storage package is a library used for managing container storage in Go applications. It provides functionalities for handling container images and their layers, allowing developers to efficiently manage storage resources. However, this package is vulnerable to a deadlock issue when processing container images, particularly when invalid tar archives are encountered.
Vulnerability Detail
A deadlock vulnerability exists in the golang-github-containers-storage package in versions prior to 1.28.1. When processing a container image, each layer is unpacked using the tar utility. If any layer is not a valid tar archive, it triggers an error that leads to the code waiting indefinitely for the tar unpacked stream to finish. This situation can be exploited by an attacker who crafts a malicious image, leading to a Denial of Service (DoS) condition as the application becomes unresponsive.
How To Fix
No fixed version is published for this vulnerability.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
As a temporary workaround, ensure that only trusted container images are processed. Implement validation checks for tar archives before unpacking them to prevent the application from entering a deadlock state.
Conclusion
The deadlock vulnerability in the golang-github-containers-storage package poses a significant risk of Denial of Service. It is crucial for developers to update to the latest version to mitigate this risk and ensure the reliability of their applications.
See every vulnerability recorded for golang-github-containers-storage →
FAQ
The CVSS score of this vulnerability is 6.5, indicating a moderate level of risk.
You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without any signup.
If an immediate update is not possible, ensure that you only use trusted images and implement validation checks for tar archives.
Exploitation of this vulnerability can lead to a Denial of Service (DoS), causing the application to become unresponsive.
More information can be found in the CVE details and related advisories linked to CVE-2021-20291.
References
Related vulnerabilities
Recent vulnerabilities recorded for golang-github-containers-storage.