CVE-2021-37661: Denial of Service Vulnerability in TensorFlow
Summary
CVE-2021-37661: Crash caused by integer conversion to unsigned. Affects tensorflow across 3 version ranges.
< 2.3.4
>= 2.4.0, < 2.4.3
>= 2.5.0, < 2.5.1
Fixed in 2.3.4, 2.4.3 or 2.5.1, 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-37661 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 open-source machine learning framework developed by Google. It provides a comprehensive ecosystem of tools, libraries, and resources for building and deploying machine learning models. The vulnerability identified as CVE-2021-37661 affects TensorFlow versions 0.0 to 2.3.4, 2.4.0 to 2.4.3, and 2.5.0 to 2.5.1. This vulnerability can be exploited to cause a denial of service (DoS) attack in the boosted_trees_create_quantile_stream_resource function.
Vulnerability Detail
The vulnerability arises from a lack of validation in the num_streams argument of the boosted_trees_create_quantile_stream_resource function. An attacker can trigger a crash by providing negative values for num_streams. This leads to an integer conversion to an unsigned value, resulting in a crash from the standard library. The impact of this vulnerability is a DoS attack, potentially disrupting the availability of the affected TensorFlow application.
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.42.3.4pip install --upgrade "tensorflow==2.3.4" -
>= 2.4.0, < 2.4.32.4.3pip install --upgrade "tensorflow==2.4.3" -
>= 2.5.0, < 2.5.12.5.1pip install --upgrade "tensorflow==2.5.1"
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 provided for this vulnerability. Users are recommended to update their TensorFlow installations to the patched versions as mentioned in the 'how_to_fix' section.
Conclusion
The vulnerability identified as CVE-2021-37661 in TensorFlow can lead to a denial of service (DoS) attack. It is crucial for users to update their TensorFlow installations to the patched versions to mitigate the vulnerability. For further support and assistance in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for tensorflow →
FAQ
The vulnerability can be exploited to cause a denial of service (DoS) attack, potentially disrupting the availability of the affected TensorFlow application.
The vulnerability affects TensorFlow versions 0.0 to 2.3.4, 2.4.0 to 2.4.3, and 2.5.0 to 2.5.1.
Yes, the vulnerability has been patched in TensorFlow commit 8a84f7a2b5a2b27ecf88d25bad9ac777cd2f7992. The fix will be included in TensorFlow 2.6.0.
No specific workarounds have been provided. It is recommended to update TensorFlow to the patched versions.
To update TensorFlow, follow the instructions provided by the TensorFlow documentation or use package managers like pip to install the latest patched versions.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.