CVE-2021-29616: TensorFlow - Null Pointer Dereference in TrySimplify
Summary
CVE-2021-29616: TensorFlow is an end-to-end open source platform for machine learning. Affects tensorflow across 5 version ranges.
>= 2.2.0, < 2.3.0rc0
< 2.2.0rc0
>= 2.3.0, < 2.3.4
>= 2.4.0, < 2.4.3
< e6340f0665d53716ef3197ada88936c2a5f7a2d3
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-29616 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 lead to undefined behavior due to a null pointer dereference in certain corner cases.
Vulnerability Detail
The vulnerability resides in the implementation of TrySimplify in TensorFlow's arithmetic optimizer. In specific scenarios where a node with no inputs is being optimized, a null pointer is dereferenced, resulting in undefined behavior. This vulnerability can potentially be exploited by an attacker to cause a denial-of-service (DoS) condition or execute arbitrary code. The impact of this vulnerability depends on the context in which TensorFlow is being used and the security measures in place.
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.2.0rc02.2.0rc0pip install --upgrade "tensorflow==2.2.0rc0" -
>= 2.2.0, < 2.3.0rc02.3.0rc0pip install --upgrade "tensorflow==2.3.0rc0" -
>= 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 follow the recommended fix by upgrading to the patched versions of TensorFlow.
Conclusion
The vulnerability in TensorFlow, identified as CVE-2021-29616, is a null pointer dereference issue in the TrySimplify implementation. It can lead to undefined behavior and potentially be exploited for DoS attacks or arbitrary code execution. Users are strongly advised to update their TensorFlow installations to the fixed versions (2.5.0, 2.4.2, 2.3.3, 2.2.3, or 2.1.4) to mitigate the vulnerability. For further support and assistance in 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 resources for developing and deploying machine learning models.
The impact of this vulnerability depends on the context in which TensorFlow is being used and the security measures in place. It can potentially lead to a denial-of-service (DoS) condition or arbitrary code execution.
The vulnerability affects TensorFlow versions 2.1.4 and later, including 2.2.x, 2.3.x, and 2.4.x. The fixed versions are TensorFlow 2.5.0 and the backported versions 2.4.2, 2.3.3, 2.2.3, and 2.1.4.
To fix this vulnerability, it is recommended to upgrade to TensorFlow 2.5.0 or one of the backported versions (2.4.2, 2.3.3, 2.2.3, or 2.1.4). Update your TensorFlow installation to the latest patched version.
No specific workaround is provided for this vulnerability. It is advised to follow the recommended fix by upgrading to the patched versions of TensorFlow.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.