CVE-2021-37687: TensorFlow-CPU - Arbitrary Data Read Vulnerability
Summary
CVE-2021-37687: TensorFlow is an end-to-end open source platform for machine learning. Affects tensorflow-cpu across 4 version ranges.
>= 2.3.0, < 2.3.4
>= 2.4.0, < 2.4.3
< bb6a0383ed553c286f87ca88c207f6774d5c4a8f
< eb921122119a6b6e470ee98b89e65d721663179d
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 · PyPI
- tensorflow · PyPI
- tensorflow-gpu · PyPI
The same CVE-2021-37687 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-CPU is a specific package that focuses on the CPU implementation of TensorFlow. It is widely used in various applications and environments for machine learning tasks.
Vulnerability Detail
The vulnerability (CVE-2021-37687) exists in the TFLite module of TensorFlow-CPU. The GatherNd and Gather implementations in TFLite do not support negative indices, but there are no checks in place to handle this situation. As a result, an attacker can exploit this flaw by crafting a malicious model with negative values in the indices parameter. By doing so, the attacker can read arbitrary data from the heap, potentially leading to information disclosure or other security breaches. The issue has been identified and patched in the GitHub commits bb6a0383ed553c286f87ca88c207f6774d5c4a8f and eb921122119a6b6e470ee98b89e65d721663179d. The fix will be included in TensorFlow 2.6.0, and it will also be backported to TensorFlow 2.5.1, TensorFlow 2.4.3, and TensorFlow 2.3.4, as these versions are also affected and within the supported range.
How To Fix
Latest published version: 2.21.0 as of 22 Oct 2026
pip install --upgrade "tensorflow-cpu==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-cpu==2.3.4" -
>= 2.4.0, < 2.4.32.4.3pip install --upgrade "tensorflow-cpu==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 specific workaround mentioned for this vulnerability. The recommended approach is to apply the available patches or upgrade to the fixed versions of TensorFlow-CPU.
Conclusion
The vulnerability (CVE-2021-37687) in TensorFlow-CPU's TFLite module poses a risk of arbitrary data read from the heap. It is crucial for users of TensorFlow-CPU to update to the patched versions (2.6.0, 2.5.1, 2.4.3, or 2.3.4) to mitigate this vulnerability. Following the official documentation and release notes will provide the necessary guidance for the upgrade process. For further support on vulnerability remediation, contact DevNack.com.
See every vulnerability recorded for tensorflow-cpu →
FAQ
TensorFlow is an open source platform for machine learning that provides tools and libraries for developing and deploying machine learning models.
TensorFlow-CPU is a specific package that focuses on the CPU implementation of TensorFlow. It is widely used for machine learning tasks in various environments.
The vulnerability allows an attacker to read arbitrary data from the heap by crafting a malicious model. This can lead to information disclosure or other security breaches.
To fix this vulnerability, update to the patched versions of TensorFlow-CPU (2.6.0, 2.5.1, 2.4.3, or 2.3.4) or apply the available patches. Follow the official documentation and release notes for detailed instructions.
No specific workaround is mentioned. It is recommended to apply the patches or upgrade to the fixed versions.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow-cpu.