CVE-2021-29560: Heap Buffer Overflow in TensorFlow
Summary
CVE-2021-29560: Heap buffer overflow in RaggedTensorToTensor. Affects tensorflow across 4 version ranges.
< 2.1.4
>= 2.2.0, < 2.2.3
>= 2.3.0, < 2.3.3
>= 2.4.0, < 2.4.2
Fixed in 4 releases; the minimum fixed version depends 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-29560 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 end-to-end 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.
Vulnerability Detail
The vulnerability identified as CVE-2021-29560 is a heap buffer overflow in the tf.raw_ops.RaggedTensorToTensor function of TensorFlow. This vulnerability arises due to a flaw in the implementation of the function, where the same index is used to access two arrays in parallel. An attacker can exploit this flaw by controlling the shape of the input arguments, leading to a heap out-of-bounds access when the parent_output_index is shorter than row_split. This can result in arbitrary code execution or a denial of service condition. The vulnerability has been assigned a CVSSv3 severity score of 9.8 (Critical).
How To Fix
Fixed versions by release line
The minimum fixed version depends on the release line you run.
-
< 2.1.42.1.4 -
>= 2.2.0, < 2.2.32.2.3 -
>= 2.3.0, < 2.3.32.3.3 -
>= 2.4.0, < 2.4.22.4.2
Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →
Workaround
There is no known workaround for this vulnerability. It is recommended to apply the official fix or upgrade to a fixed version of TensorFlow.
Conclusion
The identified vulnerability in TensorFlow (CVE-2021-29560) is a critical heap buffer overflow that can lead to arbitrary code execution or denial of service. It is crucial to apply the official fix or upgrade to a fixed version 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, widely used for developing and deploying machine learning models.
This vulnerability can allow an attacker to execute arbitrary code or cause a denial of service condition in TensorFlow applications.
To fix this vulnerability, it is recommended to upgrade to TensorFlow 2.5.0 or later. Alternatively, you can update to the fixed versions available for TensorFlow 2.4.2, 2.3.3, 2.2.3, and 2.1.4.
No, there is no known workaround for this vulnerability. It is recommended to apply the official fix or upgrade to a fixed version.
You can find more information about this vulnerability in the official CVE entry (CVE-2021-29560) and the TensorFlow release notes.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.