CVE-2020-15265: TensorFlow GPU - Out-of-Bounds Access Vulnerability
Summary
CVE-2020-15265: In Tensorflow before version 2.4.0, an attacker can pass an invalid axis value to tf.quantization.quantize_and_dequantize. Affects tensorflow-gpu across 2 version ranges.
< 2.4.0
< eccb7ec454e6617738554a255d77f08e60ee0808
Fixed in eccb7ec454e6617738554a255d77f08e60ee0808. How to fix ↓
Also tracked for
- tensorflow · Bitnami
- tensorflow · PyPI
- tensorflow · PyPI
- tensorflow-cpu · PyPI
The same CVE-2020-15265 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 building and deploying machine learning models. It provides a comprehensive ecosystem of tools, libraries, and community resources to facilitate the development of AI applications. The TensorFlow GPU package, available on PyPI, is specifically designed to leverage GPU acceleration for faster training and inference. However, a vulnerability has been discovered in versions prior to 2.4.0 that allows an attacker to trigger an out-of-bounds access in the C++ kernel implementation of the tf.quantization.quantize_and_dequantize function.
Vulnerability Detail
By passing an invalid axis value to tf.quantization.quantize_and_dequantize, an attacker can cause a segmentation fault and access elements outside the rank of the input tensor. The issue arises due to insufficient validation of the axis argument, which is used to access an array element without proper bounds checking. This vulnerability can potentially lead to a denial-of-service condition or arbitrary code execution, depending on the context in which TensorFlow is used.
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 version below is the minimum fixed release for this vulnerability.
If you need the minimum change
eccb7ec454e6617738554a255d77f08e60ee0808
This is the first release that contains the fix.
pip install --upgrade "tensorflow-gpu==eccb7ec454e6617738554a255d77f08e60ee0808"
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, users can manually validate the axis value before passing it to the tf.quantization.quantize_and_dequantize function. This can be done by checking the rank of the input tensor and ensuring that the axis value is within the valid range. Here's an example of how to perform this validation in Python:
import tensorflow as tf
def quantize_and_dequantize_safe(tensor, axis):
rank = tf.rank(tensor)
if axis < 0 or axis >= rank:
raise ValueError('Invalid axis value')
return tf.quantization.quantize_and_dequantize(tensor, axis)
Conclusion
The vulnerability in TensorFlow GPU versions prior to 2.4.0 allows for an out-of-bounds access, which can have severe consequences such as denial-of-service or arbitrary code execution. It is crucial to update to the latest version of TensorFlow GPU (2.4.0 or later) to mitigate this vulnerability. Additionally, users can implement a temporary workaround by validating the axis value manually. 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 deploying AI models. It provides a wide range of tools and libraries for developing machine learning applications.
The TensorFlow GPU package is a variant of TensorFlow that leverages GPU acceleration for faster training and inference. It is specifically designed to work with compatible NVIDIA GPUs.
This vulnerability allows an attacker to trigger an out-of-bounds access in the TensorFlow GPU package, potentially leading to a denial-of-service condition or arbitrary code execution.
To fix this vulnerability, update your TensorFlow GPU package to version 2.4.0 or later. Use the command pip install --upgrade tensorflow-gpu to update your installation.
Yes, a temporary workaround is to manually validate the axis value before using the tf.quantization.quantize_and_dequantize function. Ensure that the axis value is within the valid range.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow-gpu.