CVE-2021-29592: TensorFlow GPU - Reshape Operator Null Buffer Vulnerability
Summary
CVE-2021-29592: TensorFlow is an end-to-end open source platform for machine learning. Affects tensorflow-gpu 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-cpu · 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 resources for developing and deploying machine learning models. TensorFlow GPU is a variant of TensorFlow that leverages GPU acceleration for faster training and inference. It is widely used in various industries and research domains for deep learning tasks.
Vulnerability Detail
The Reshape operator in TensorFlow GPU is vulnerable to a null buffer issue. The vulnerability (CVE-2021-29592) arises from a missed case in the fix for CVE-2020-15209. The fix for the previous vulnerability allowed passing a null-buffer-backed tensor with a 1D shape when the target shape of the Reshape operator is given by the elements of a 1-D tensor. This can lead to unexpected behavior or crashes in TensorFlow GPU applications that utilize the Reshape operator.
How To Fix
Latest published version: 2.12.0 as of 22 Oct 2026
pip install --upgrade "tensorflow-gpu==2.12.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-gpu==2.1.4" -
>= 2.2.0, < 2.2.32.2.3pip install --upgrade "tensorflow-gpu==2.2.3" -
>= 2.3.0, < 2.3.32.3.3pip install --upgrade "tensorflow-gpu==2.3.3" -
>= 2.4.0, < 2.4.22.4.2pip install --upgrade "tensorflow-gpu==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 specific workaround provided for this vulnerability. However, users can consider avoiding the usage of the Reshape operator with a target shape defined by the elements of a 1-D tensor until they can upgrade to a patched version of TensorFlow GPU.
Conclusion
The Reshape operator null buffer vulnerability in TensorFlow GPU can lead to unexpected behavior or crashes in affected applications. It is crucial to upgrade to the patched versions of TensorFlow GPU (2.5.0, 2.4.2, 2.3.3, 2.2.3, or 2.1.4) to mitigate the vulnerability. For further assistance or support in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for tensorflow-gpu →
FAQ
The vulnerability can lead to unexpected behavior or crashes in TensorFlow GPU applications that utilize the Reshape operator with a target shape defined by the elements of a 1-D tensor.
No, only TensorFlow GPU versions 2.1.4 and above are affected. Versions prior to 2.1.4 are not impacted by this vulnerability.
There is no known exploit for this vulnerability at the time of this advisory. However, it is recommended to apply the patches as soon as possible to prevent any potential exploitation.
Yes, you can continue using TensorFlow GPU. However, it is recommended to avoid using the Reshape operator with a target shape defined by the elements of a 1-D tensor until you can upgrade to a patched version.
You can find more information about the vulnerability in the official TensorFlow security advisory (PYSEC-2021-718) and the associated CVE entry (CVE-2021-29592).
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow-gpu.