CVE-2021-29569: TensorFlow GPU - Out-of-Bounds Read in MaxPoolGradWithArgmax
Summary
CVE-2021-29569: 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
< ef0c008ee84bad91ec6725ddc42091e19a30cf0e
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-29569 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 computation. It is widely used in various industries and research domains for deep learning tasks.
Vulnerability Detail
The vulnerability (CVE-2021-29569) exists in the implementation of tf.raw_ops.MaxPoolGradWithArgmax in TensorFlow GPU. By supplying specially crafted inputs, an attacker can trigger an out-of-bounds read, leading to potential information disclosure or denial of service. The issue arises from the assumption made in the implementation that the input_min and input_max tensors have at least one element. If these tensors are empty, accessing the 0th element results in a read outside the bounds of the allocated data. The vulnerability affects versions of TensorFlow GPU from 0 to 2.1.4, 2.2.0 to 2.2.3, 2.3.0 to 2.3.3, and 2.4.0 to 2.4.2.
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
As a workaround, users can avoid the vulnerability by ensuring that the input_min and input_max tensors passed to tf.raw_ops.MaxPoolGradWithArgmax have at least one element. This can be achieved by validating the input tensors before invoking the vulnerable function. Here's an example in Python:
import tensorflow as tf
# Validate input tensors
if len(input_min) == 0 or len(input_max) == 0:
# Handle empty tensors
print('Input tensors must have at least one element.')
else:
# Invoke the vulnerable function
result = tf.raw_ops.MaxPoolGradWithArgmax(input_min, input_max)
Conclusion
In conclusion, the vulnerability (CVE-2021-29569) in TensorFlow GPU's tf.raw_ops.MaxPoolGradWithArgmax function can result in an out-of-bounds read if attacker-controlled inputs are supplied. The TensorFlow development team has addressed the issue in the latest versions, and users are advised to upgrade to mitigate the vulnerability. It is crucial to keep software dependencies up to date and follow best practices for secure development. For further support on vulnerability remediation, you can reach out to DevNack.com.
See every vulnerability recorded for tensorflow-gpu →
FAQ
TensorFlow is an open source platform for machine learning that 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 computation. It is widely used in various industries and research domains for deep learning tasks.
The vulnerability in TensorFlow GPU can potentially lead to information disclosure or denial of service. An attacker can exploit the vulnerability by supplying specially crafted inputs, triggering an out-of-bounds read.
The vulnerability affects TensorFlow GPU versions from 0 to 2.1.4, 2.2.0 to 2.2.3, 2.3.0 to 2.3.3, and 2.4.0 to 2.4.2.
To fix the vulnerability, it is recommended to upgrade to the latest available version of TensorFlow GPU (2.5.0, 2.4.2, 2.3.3, 2.2.3, or 2.1.4). Users can update their TensorFlow GPU installation using the package manager or by following the official upgrade instructions provided by the TensorFlow project.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow-gpu.