CVE-2021-29616: TensorFlow-CPU - Null Pointer Dereference in TrySimplify
Summary
CVE-2021-29616: TensorFlow is an end-to-end open source platform for machine learning. Affects tensorflow-cpu 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 · PyPI
- tensorflow · 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 community resources that enable researchers and developers to build and deploy machine learning models. TensorFlow-CPU is a Python package that allows users to run TensorFlow on CPUs. It is widely used in various industries for machine learning tasks.
Vulnerability Detail
The vulnerability (CVE-2021-29616) exists in the TensorFlow-CPU package. It is caused by a null pointer dereference in the implementation of TrySimplify function in the arithmetic optimizer module. In certain corner cases where a node with no inputs is being optimized, the code dereferences a null pointer, leading to undefined behavior. This vulnerability can be exploited by an attacker to cause a denial-of-service (DoS) condition or potentially execute arbitrary code.
How To Fix
Latest published version: 2.21.0 as of 22 Oct 2026
pip install --upgrade "tensorflow-cpu==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-cpu==2.2.0rc0" -
>= 2.2.0, < 2.3.0rc02.3.0rc0pip install --upgrade "tensorflow-cpu==2.3.0rc0" -
>= 2.3.0, < 2.3.42.3.4pip install --upgrade "tensorflow-cpu==2.3.4" -
>= 2.4.0, < 2.4.32.4.3pip install --upgrade "tensorflow-cpu==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 known workaround for this vulnerability. It is recommended to update to the patched versions of TensorFlow-CPU as mentioned in the 'how_to_fix' section.
Conclusion
The vulnerability (CVE-2021-29616) in TensorFlow-CPU can be mitigated by updating to the patched versions mentioned in the 'how_to_fix' section. It is crucial to keep software dependencies up to date to ensure the security and stability of machine learning applications. For further support on vulnerability remediation, you can contact DevNack.com.
See every vulnerability recorded for tensorflow-cpu →
FAQ
TensorFlow is an open source platform for machine learning that provides tools and libraries for building and deploying machine learning models.
TensorFlow-CPU is a Python package that allows users to run TensorFlow on CPUs. It is a variant of TensorFlow optimized for CPU performance.
This vulnerability can be exploited by an attacker to cause a denial-of-service (DoS) condition or potentially execute arbitrary code.
To fix this vulnerability, update TensorFlow-CPU to version 2.5.0 or later. Alternatively, you can update to TensorFlow 2.4.2, TensorFlow 2.3.3, TensorFlow 2.2.3, or TensorFlow 2.1.4.
There is no known workaround for this vulnerability. It is recommended to update to the patched versions of TensorFlow-CPU.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow-cpu.