CVE-2021-37664: TensorFlow - Out-of-Bounds Read in BoostedTreesSparseCalculateBestFeatureSplit
Summary
CVE-2021-37664: TensorFlow is an end-to-end open source platform for machine learning. Affects tensorflow across 3 version ranges.
>= 2.3.0, < 2.3.4
>= 2.4.0, < 2.4.3
< e84c975313e8e8e38bb2ea118196369c45c51378
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-37664 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 domains, including research, industry, and academia. This vulnerability affects the TensorFlow package and can be exploited by an attacker to read from outside the bounds of heap allocated data.
Vulnerability Detail
The vulnerability exists in the BoostedTreesSparseCalculateBestFeatureSplit function of TensorFlow. By sending specially crafted illegal arguments, an attacker can trigger an out-of-bounds read in the stats_summary_indices array. The implementation fails to validate that each value in stats_summary_indices is within the expected range, leading to the out-of-bounds read. This vulnerability can be exploited to leak sensitive information or potentially execute arbitrary code. The issue has been patched in the GitHub commit e84c975313e8e8e38bb2ea118196369c45c51378 and will be included in TensorFlow 2.6.0. Additionally, the fix has been backported to TensorFlow 2.5.1, TensorFlow 2.4.3, and TensorFlow 2.3.4.
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 →
Conclusion
The out-of-bounds read vulnerability in TensorFlow can be mitigated by updating the package to the patched versions or by applying the relevant patches. It is important to keep software dependencies up to date to ensure the security of machine learning applications. For further support on vulnerability remediation, you can reach out to DevNack.com.
See every vulnerability recorded for tensorflow →
FAQ
TensorFlow is an open source platform for machine learning that provides a range of tools and resources for developing and deploying machine learning models.
This vulnerability allows an attacker to read from outside the bounds of heap allocated data, potentially leading to information leakage or arbitrary code execution.
To fix this vulnerability, update TensorFlow to version 2.6.0 or apply the relevant patches for TensorFlow 2.5.1, TensorFlow 2.4.3, and TensorFlow 2.3.4.
No specific workaround has been provided for this vulnerability. It is recommended to update TensorFlow to the patched versions.
You can find more information about this vulnerability in the TensorFlow advisory PYSEC-2021-286.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.