CVE-2021-41221: TensorFlow Heap Buffer Overflow
Summary
CVE-2021-41221: Access to invalid memory during shape inference in Cudnn* ops. Affects tensorflow across 3 version ranges.
>= 2.4.0, < 2.4.4
>= 2.5.0, < 2.5.2
>= 2.6.0, < 2.6.1
Fixed in 2.4.4, 2.5.2 or 2.6.1, depending on the release line you run. How to fix ↓
Also tracked for
- tensorflow · PyPI
- tensorflow · PyPI
- tensorflow-cpu · PyPI
- tensorflow-gpu · PyPI
The same CVE-2021-41221 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
TensorFlow is an open source platform for machine learning. It provides a comprehensive ecosystem of tools, libraries, and resources for developing and deploying machine learning models. TensorFlow is widely used in various industries and research fields for tasks such as image recognition, natural language processing, and predictive analytics. However, a vulnerability has been discovered in TensorFlow that can lead to a heap buffer overflow.
Vulnerability Detail
The vulnerability in TensorFlow lies in the shape inference code for the Cudnn* operations. This code can be tricked into accessing invalid memory, resulting in a heap buffer overflow. The issue arises because the ranks of the input, input_h, and input_c parameters are not properly validated, but the code assumes certain values for them. This can be exploited by an attacker to execute arbitrary code or cause a denial of service. The vulnerability has been assigned CVE-2021-41221 and has a severity rating of High.
How To Fix
Fixed versions by release line
The minimum fixed version depends on the release line you run.
-
>= 2.4.0, < 2.4.42.4.4 -
>= 2.5.0, < 2.5.22.5.2 -
>= 2.6.0, < 2.6.12.6.1
Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →
Workaround
As of now, there is no known workaround for this vulnerability. It is recommended to apply the official patch or upgrade to the latest patched version of TensorFlow as soon as it is released.
Conclusion
The vulnerability in TensorFlow can lead to a heap buffer overflow, potentially allowing an attacker to execute arbitrary code or cause a denial of service. It is important to stay updated with the latest patched version of TensorFlow to mitigate the risk. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for tensorflow →
FAQ
TensorFlow is an open source platform for machine learning that provides a comprehensive ecosystem of tools and resources for developing and deploying machine learning models.
A heap buffer overflow is a type of vulnerability where a program writes data beyond the allocated memory buffer, potentially overwriting important data or executing arbitrary code.
This vulnerability can be exploited by tricking the shape inference code in TensorFlow into accessing invalid memory, leading to a heap buffer overflow. An attacker can use this to execute arbitrary code or cause a denial of service.
This vulnerability has a severity rating of High.
To protect your system, it is recommended to upgrade to the latest patched version of TensorFlow as soon as it becomes available. Regularly updating your TensorFlow installation is crucial to mitigate the risk of this vulnerability.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.