CVE-2021-37660: TensorFlow GPU Division by Zero Vulnerability
Summary
CVE-2021-37660: TensorFlow is an end-to-end open source platform for machine learning. Affects tensorflow-gpu across 3 version ranges.
>= 2.3.0, < 2.3.4
>= 2.4.0, < 2.4.3
< e86605c0a336c088b638da02135ea6f9f6753618
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-cpu · PyPI
The same CVE-2021-37660 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 building and deploying machine learning models. TensorFlow is widely used in various industries and research domains for tasks such as image recognition, natural language processing, and recommendation systems. The TensorFlow GPU package, available on PyPI, is specifically designed to leverage the computational power of GPUs for accelerated machine learning tasks.
Vulnerability Detail
In affected versions of TensorFlow GPU, an attacker can exploit a vulnerability that leads to a floating point exception. By calling inplace operations with crafted arguments, the attacker can trigger a division by zero error. The vulnerability arises from a logic error in the implementation of inplace operations, where the code incorrectly uses the logical OR operator instead of the logical AND operator to check if the input tensors are empty. This flaw allows the division operation to proceed even when the input tensors are empty, resulting in a floating point exception. An attacker can potentially exploit this vulnerability to cause a denial of service (DoS) condition or to execute arbitrary code.
How To Fix
Latest published version: 2.12.0 as of 22 Oct 2026
pip install --upgrade "tensorflow-gpu==2.12.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-gpu==2.3.4" -
>= 2.4.0, < 2.4.32.4.3pip install --upgrade "tensorflow-gpu==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 recommended to apply the official patch or update to the latest version of TensorFlow GPU as soon as possible.
Conclusion
The TensorFlow GPU Division by Zero vulnerability (CVE-2021-37660) poses a significant risk to systems running affected versions of TensorFlow GPU. It is crucial for users to update their installations to the latest patched version or apply the official patch as soon as possible to mitigate the vulnerability. For further support and assistance with vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for tensorflow-gpu →
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.
The TensorFlow GPU package is a specific variant of TensorFlow that is optimized to leverage the computational power of GPUs for accelerated machine learning tasks.
This vulnerability allows an attacker to trigger a floating point exception by exploiting a division by zero error. It can potentially lead to a denial of service (DoS) condition or enable the execution of arbitrary code.
To fix this vulnerability, it is recommended to update TensorFlow GPU to version 2.6.0 or later. The issue has been patched in the latest release.
There is no known workaround for this vulnerability. It is recommended to apply the official patch or update to the latest version of TensorFlow GPU.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow-gpu.