CVE-2021-37655: TensorFlow - Out-of-Bounds Read Vulnerability
Summary
CVE-2021-37655: TensorFlow is an end-to-end open source platform for machine learning. Affects tensorflow across 3 version ranges.
< 01cff3f986259d661103412a20745928c727326f
>= 2.3.0, < 2.3.4
>= 2.4.0, < 2.4.3
Fixed in 2.3.4 or 2.4.3, depending on the release line you run. How to fix ↓
Also tracked for
- tensorflow · Bitnami
- tensorflow-cpu · PyPI
- tensorflow-gpu · PyPI
The same CVE-2021-37655 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 community resources that enable researchers and developers to build and deploy machine learning models. TensorFlow is widely used in various domains, including computer vision, natural language processing, and deep learning.
Vulnerability Detail
The vulnerability identified as CVE-2021-37655 affects TensorFlow versions 2.3.0 and above. It resides in the tf.raw_ops.ResourceScatterUpdate function, which is responsible for updating resource tensors. By sending invalid arguments to this function, an attacker can trigger a read from outside the bounds of heap allocated data. The issue arises due to incomplete validation of the relationship between the shapes of indices and updates. Instead of checking that the shape of indices is a prefix of the shape of updates, the code only verifies that the number of elements in these two tensors are in a divisibility relationship. This oversight allows an attacker to exploit the vulnerability and potentially access sensitive information or execute arbitrary code.
How To Fix
Latest published version: 2.21.0 as of 22 Oct 2026
pip install --upgrade "tensorflow==2.21.0"
Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.
If you can't move to the latest
The minimum fixed version depends on the release line you run.
-
>= 2.3.0, < 2.3.42.3.4pip install --upgrade "tensorflow==2.3.4" -
>= 2.4.0, < 2.4.32.4.3pip install --upgrade "tensorflow==2.4.3"
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 crucial to apply the provided fix or update to the patched versions as soon as possible.
Conclusion
The vulnerability in TensorFlow (CVE-2021-37655) poses a significant risk to systems utilizing affected versions. It is crucial to apply the provided fix or update to the patched versions to mitigate the potential impact. For further support and assistance in 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 set of tools and libraries for building and deploying machine learning models.
This vulnerability allows an attacker to read data from outside the bounds of heap allocated memory, potentially leading to information disclosure or arbitrary code execution.
The vulnerability affects TensorFlow versions 2.3.0 and above.
Yes, the TensorFlow team has addressed the vulnerability in the following versions: TensorFlow 2.6.0, TensorFlow 2.5.1, TensorFlow 2.4.3, and TensorFlow 2.3.4.
To update TensorFlow, you can use the appropriate package manager command, such as pip install --upgrade tensorflow==2.5.1.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.