CVE-2021-37662: TensorFlow BoostedTreesCalculateBestGainsPerFeature and BoostedTreesCalculateBestFeatureSplitV2 Null Pointer Dereference
Summary
CVE-2021-37662: TensorFlow is an end-to-end open source platform for machine learning. Affects tensorflow across 4 version ranges.
>= 2.3.0, < 2.3.4
>= 2.4.0, < 2.4.3
< 9c87c32c710d0b5b53dc6fd3bfde4046e1f7a5ad
< 429f009d2b2c09028647dd4bb7b3f6f414bbaad7
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-37662 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 domains, including research, industry, and academia. It offers support for both deep learning and traditional machine learning algorithms, making it a versatile framework for developing and training models. However, certain versions of TensorFlow are vulnerable to a null pointer dereference issue in the BoostedTreesCalculateBestGainsPerFeature and BoostedTreesCalculateBestFeatureSplitV2 functions.
Vulnerability Detail
The vulnerability arises due to a lack of input validation in the affected functions. An attacker can exploit this vulnerability by providing crafted input values that result in a reference binding to nullptr. This can lead to undefined behavior and potentially enable the attacker to execute arbitrary code or cause a denial of service. The vulnerability affects multiple versions of TensorFlow, including 2.3.0 to 2.3.4, 2.4.0 to 2.4.3, and 2.5.0 to 2.5.1.
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 →
Workaround
There is no specific workaround provided for this vulnerability. However, users can mitigate the risk by ensuring that their TensorFlow installations are up to date with the latest patches and following best practices for secure coding and deployment of machine learning models.
Conclusion
The null pointer dereference vulnerability in TensorFlow's BoostedTreesCalculateBestGainsPerFeature and BoostedTreesCalculateBestFeatureSplitV2 functions can be exploited by an attacker to execute arbitrary code or cause a denial of service. The TensorFlow development team has released patches to address this vulnerability, and users are advised to update their installations as soon as the patched versions become available. 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 tools and libraries for building and deploying models.
The vulnerability can allow an attacker to execute arbitrary code or cause a denial of service.
The vulnerability affects TensorFlow versions 2.3.0 to 2.3.4, 2.4.0 to 2.4.3, and 2.5.0 to 2.5.1.
Update your TensorFlow installation to the patched versions (2.6.0, 2.5.1, 2.4.3, or 2.3.4) once they are available.
There are no specific workarounds provided. However, keeping your TensorFlow installation up to date and following secure coding practices can help mitigate the risk.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.