CVE-2021-29576: TensorFlow GPU - Heap Buffer Overflow in tf.raw_ops.MaxPool3DGradGrad
Summary
CVE-2021-29576: 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
< 63c6a29d0f2d692b247f7bf81f8732d6442fad09
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-29576 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 GPU is a variant of TensorFlow that leverages GPU acceleration for faster computation. It is widely used in various domains, including computer vision, natural language processing, and reinforcement learning.
Vulnerability Detail
The vulnerability (CVE-2021-29576) affects the implementation of tf.raw_ops.MaxPool3DGradGrad in TensorFlow GPU. The issue arises due to the incomplete initialization of Pool3dParameters in the constructor of MaxPool3DGradGrad. The constructor uses OP_REQUIRES to validate conditions, but it does not check if the initialization of params completes successfully. As a result, params may contain invalid data, leading to a potential heap buffer overflow. The impact of the vulnerability depends on the default initialized values, which may vary across different versions of TensorFlow GPU. The vulnerability has been assigned the identifier CVE-2021-29576 and the GHSA identifier GHSA-7cqx-92hp-x6wh.
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
No specific workaround has been provided for this vulnerability. Users are advised to update to the patched versions of TensorFlow GPU as soon as they become available.
Conclusion
The vulnerability (CVE-2021-29576) in TensorFlow GPU's tf.raw_ops.MaxPool3DGradGrad function exposes a potential heap buffer overflow. It is crucial for users of TensorFlow GPU to update their installations to the patched versions once they are released. Regularly checking for updates and promptly applying them is essential to maintain the security and stability of TensorFlow GPU. For further support and assistance with vulnerability remediation, you can reach out to DevNack.com.
See every vulnerability recorded for tensorflow-gpu →
FAQ
TensorFlow GPU is a variant of TensorFlow that utilizes GPU acceleration for faster machine learning computations. It is commonly used in scenarios where high-performance computing is required, such as computer vision and natural language processing.
The impact of this vulnerability is dependent on the default initialized values in different versions of TensorFlow GPU. If the default values lead to a heap buffer overflow, it could potentially be exploited by an attacker to execute arbitrary code or cause a denial-of-service condition.
You can use the Vulert Playground (https://vulert.com/scanner) to check if your TensorFlow GPU installation is affected by this vulnerability. Simply provide your Pipfile.lock and the playground will analyze it for any open-source vulnerabilities, including CVE-2021-29576.
No specific workaround has been provided for this vulnerability. It is recommended to update to the patched versions of TensorFlow GPU as soon as they are released.
To update your TensorFlow GPU installation, you can use the package manager or update mechanism specific to your operating system or package manager. Alternatively, you can follow the official documentation provided by TensorFlow to ensure a smooth update process.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow-gpu.