CVE-2021-29584: Denial of Service Vulnerability in TensorFlow
Summary
CVE-2021-29584: TensorFlow is an end-to-end open source platform for machine learning. Affects tensorflow across 5 version ranges.
< 2.1.4
>= 2.2.0, < 2.2.3
>= 2.3.0, < 2.3.3
>= 2.4.0, < 2.4.2
< 4c0ee937c0f61c4fc5f5d32d9bb4c67428012a60
Fixed in 4 releases; the minimum fixed version depends on the release line you run. How to fix ↓
Also tracked for
- tensorflow · Bitnami
- tensorflow-cpu · PyPI
- tensorflow-gpu · PyPI
The same CVE-2021-29584 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 domains for tasks such as image recognition, natural language processing, and recommendation systems.
Vulnerability Detail
The vulnerability (CVE-2021-29584) in TensorFlow allows an attacker to trigger a denial of service (DoS) attack. The issue arises from an integer overflow when constructing a new tensor shape. The implementation builds a dense shape without checking for overflow, leading to a CHECK-fail in the TensorShape constructor. This vulnerability can be exploited by an attacker to crash the TensorFlow application, causing a DoS condition. The issue affects versions 2.1.4 and above of TensorFlow.
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.1.42.1.4pip install --upgrade "tensorflow==2.1.4" -
>= 2.2.0, < 2.2.32.2.3pip install --upgrade "tensorflow==2.2.3" -
>= 2.3.0, < 2.3.32.3.3pip install --upgrade "tensorflow==2.3.3" -
>= 2.4.0, < 2.4.22.4.2pip install --upgrade "tensorflow==2.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 specific workaround available for this vulnerability. The recommended approach is to update to the patched version of TensorFlow.
Conclusion
The vulnerability (CVE-2021-29584) in TensorFlow can be exploited by an attacker to trigger a denial of service attack. To mitigate this risk, it is crucial to update to the latest patched version of TensorFlow. 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 set of tools and libraries for developing and deploying machine learning models.
The vulnerability allows an attacker to trigger a denial of service attack, potentially crashing the TensorFlow application and causing a disruption in its functionality.
The vulnerability affects TensorFlow versions 2.1.4 and above.
To fix this vulnerability, it is recommended to upgrade to the latest patched version of TensorFlow (2.5.0, 2.4.2, 2.3.3, 2.2.3, or 2.1.4).
There is no specific workaround available for this vulnerability. Updating to the patched version of TensorFlow is the recommended solution.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.