CVE-2022-21726: TensorFlow GPU - Heap Out-of-Bounds Access in Dequantize
Summary
CVE-2022-21726: Tensorflow is an Open Source Machine Learning Framework. Affects tensorflow-gpu across 3 version ranges.
< 2.5.3
>= 2.6.0, < 2.6.3
< 23968a8bf65b009120c43b5ebcceaf52dbc9e943
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-21726 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 set of tools and libraries for building and training neural networks. TensorFlow GPU is a variant of TensorFlow that leverages the power of GPUs for accelerated computation.
Vulnerability Detail
The vulnerability (CVE-2022-21726) affects the Dequantize function in TensorFlow GPU. This function is responsible for converting quantized tensors back to floating-point tensors. The issue arises from inadequate validation of the axis argument, which specifies the axis along which the dequantization should be performed. The axis argument can be set to -1 or any positive value up to the number of dimensions of the input tensor. However, the upper bound is not properly checked, leading to heap out-of-bounds accesses. An attacker could exploit this vulnerability to read past the end of the array containing the dimensions of the input tensor, potentially resulting in information disclosure or arbitrary code execution.
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 avoid using the Dequantize function with a custom axis value. Stick to the default value of -1 or use one of the valid positive values up to the number of dimensions of the input tensor. By doing so, the vulnerability can be bypassed.
Conclusion
The vulnerability (CVE-2022-21726) in TensorFlow GPU's Dequantize function can result in heap out-of-bounds accesses. It is crucial to update to the latest patched version of TensorFlow GPU or apply the provided workaround to mitigate the risk. For further assistance or support in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for tensorflow-gpu →
FAQ
TensorFlow is an open-source machine learning framework used for building and training neural networks. It provides a wide range of tools and libraries for developing machine learning models.
TensorFlow GPU is a variant of TensorFlow that utilizes the power of GPUs for accelerated computation. It is specifically designed to leverage the parallel processing capabilities of GPUs to enhance performance.
Dequantize is a function in TensorFlow GPU that converts quantized tensors, which represent numbers with reduced precision, back to floating-point tensors with full precision. It is commonly used in machine learning models that involve quantization techniques.
The vulnerability can be exploited by providing a malicious axis value to the Dequantize function. By setting an invalid axis value that exceeds the number of dimensions of the input tensor, an attacker can trigger heap out-of-bounds accesses, potentially leading to information disclosure or arbitrary code execution.
Yes, the vulnerability will be fixed in TensorFlow 2.8.0. The fix will also be backported to TensorFlow 2.7.1, TensorFlow 2.6.3, and TensorFlow 2.5.3. It is recommended to update to the latest patched version of TensorFlow GPU to mitigate the vulnerability.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow-gpu.