CVE-2022-21730: TensorFlow GPU FractionalAvgPoolGrad Heap Read Overflow
Summary
CVE-2022-21730: Tensorflow is an Open Source Machine Learning Framework. Affects tensorflow-gpu across 3 version ranges.
< 2.5.3
>= 2.6.0, < 2.6.3
< 002408c3696b173863228223d535f9de72a101a9
Fixed in 2.5.3 or 2.6.3, depending on the release line you run. How to fix ↓
Also tracked for
- tensorflow · PyPI
- tensorflow · Bitnami
- tensorflow · PyPI
- tensorflow-cpu · PyPI
The same CVE-2022-21730 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 open-source machine learning framework widely used for developing and deploying machine learning models. It provides a comprehensive ecosystem for building and training neural networks. TensorFlow GPU is a variant of TensorFlow that leverages the power of GPUs for accelerated computation. It allows users to train and run machine learning models efficiently on GPU hardware.
Vulnerability Detail
The vulnerability (CVE-2022-21730) exists in the implementation of FractionalAvgPoolGrad in TensorFlow GPU. This vulnerability arises due to the lack of proper input validation, allowing an attacker to read data from outside the bounds of the heap. By exploiting this vulnerability, an attacker could potentially access sensitive information or execute arbitrary code, leading to a breach of confidentiality, integrity, or availability of the system. The vulnerability affects versions of TensorFlow GPU up to and including 2.5.3, 2.6.3, and 2.7.1.
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.5.32.5.3pip install --upgrade "tensorflow-gpu==2.5.3" -
>= 2.6.0, < 2.6.32.6.3pip install --upgrade "tensorflow-gpu==2.6.3"
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 temporary workaround, users can consider avoiding the usage of FractionalAvgPoolGrad or any functionality that relies on it until the fix is applied. This can be achieved by modifying the code to use alternative pooling methods or by skipping the affected operations altogether. Here's an example of how to replace FractionalAvgPoolGrad with MaxPoolGrad:
import tensorflow as tf
# Replace FractionalAvgPoolGrad with MaxPoolGrad
output = tf.nn.max_pool_grad(input, ksize=ksize, strides=strides, padding=padding)
Please note that this workaround may impact the performance or accuracy of the machine learning model, so it should be used with caution.
Conclusion
The vulnerability (CVE-2022-21730) in TensorFlow GPU's FractionalAvgPoolGrad function poses a risk to the security and integrity of machine learning systems utilizing TensorFlow GPU. It is crucial to promptly apply the recommended fixes by upgrading to TensorFlow GPU 2.8.0 or applying the relevant patches for the affected versions. For further assistance or support in addressing this vulnerability, please reach out to DevNack.com.
See every vulnerability recorded for tensorflow-gpu →
FAQ
TensorFlow GPU is a variant of TensorFlow that utilizes the power of GPUs for accelerated computation. It allows users to train and run machine learning models efficiently on GPU hardware, resulting in faster training and inference times.
The vulnerability in FractionalAvgPoolGrad allows an attacker to read data from outside the bounds of the heap. This can potentially lead to unauthorized access to sensitive information or the execution of arbitrary code, compromising the security and integrity of the TensorFlow GPU system.
The vulnerability affects TensorFlow GPU versions up to and including 2.5.3, 2.6.3, and 2.7.1. It is recommended to upgrade to TensorFlow GPU 2.8.0 or apply the relevant patch for the affected versions.
To fix the vulnerability, you should upgrade to TensorFlow GPU 2.8.0 or apply the relevant patch for the affected versions (2.7.1, 2.6.3, and 2.5.3). The TensorFlow development team has released the necessary fixes to address this vulnerability.
As a temporary workaround, you can avoid using FractionalAvgPoolGrad or any functionality that relies on it. Instead, consider using alternative pooling methods or skipping the affected operations until the fix is applied. However, please note that this workaround may impact the performance or accuracy of your machine learning models.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow-gpu.