CVE-2021-29592: TensorFlow CPU - Reshape Operator Null Buffer Vulnerability
Summary
CVE-2021-29592: TensorFlow is an end-to-end open source platform for machine learning. Affects tensorflow-cpu across 5 version ranges.
< 2.1.4
>= 2.2.0, < 2.2.3
>= 2.3.0, < 2.3.3
>= 2.4.0, < 2.4.2
< f8378920345f4f4604202d4ab15ef64b2aceaa16
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-29592 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 is widely used in various industries and applications, including image recognition, natural language processing, and recommendation systems. The vulnerability described in this report affects the TensorFlow CPU package, which is a Python package that provides CPU-only support for TensorFlow.
Vulnerability Detail
The vulnerability (CVE-2021-29592) in TensorFlow CPU arises from a missed case in the fix for CVE-2020-15209. The fix for CVE-2020-15209 aimed to prevent passing a null-buffer-backed tensor with a 1D shape to the Reshape operator. However, the fix did not account for cases where the target shape of the Reshape operator is given by the elements of a 1-D tensor. As a result, it is possible to pass a null-buffer-backed tensor with a 1D shape, which can lead to unexpected behavior or crashes in TensorFlow applications. This vulnerability affects versions of TensorFlow CPU from 0 to 2.4.2.
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.1.42.1.4pip install --upgrade "tensorflow-cpu==2.1.4" -
>= 2.2.0, < 2.2.32.2.3pip install --upgrade "tensorflow-cpu==2.2.3" -
>= 2.3.0, < 2.3.32.3.3pip install --upgrade "tensorflow-cpu==2.3.3" -
>= 2.4.0, < 2.4.22.4.2pip install --upgrade "tensorflow-cpu==2.4.2"
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 apply the fix by updating TensorFlow CPU to a fixed version.
Conclusion
The vulnerability (CVE-2021-29592) in TensorFlow CPU can be mitigated by updating to a fixed version of the package. It is recommended to upgrade to TensorFlow CPU version 2.5.0 or later to ensure the vulnerability is patched. For further support on vulnerability remediation, you can reach out to DevNack.com.
See every vulnerability recorded for tensorflow-cpu →
FAQ
TensorFlow is an open source platform for machine learning that provides a comprehensive ecosystem of tools, libraries, and community resources.
This vulnerability can lead to unexpected behavior or crashes in TensorFlow applications.
Versions of TensorFlow CPU from 0 to 2.4.2 are affected by this vulnerability.
To fix this vulnerability, update TensorFlow CPU to version 2.5.0 or later.
There is no known workaround for this vulnerability. It is recommended to update to a fixed version of TensorFlow CPU.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow-cpu.