CVE-2020-15265: TensorFlow CPU - Out-of-Bounds Access in tf.quantization.quantize_and_dequantize
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-cpu across 2 version ranges.
< 2.4.0
< eccb7ec454e6617738554a255d77f08e60ee0808
Fixed in eccb7ec454e6617738554a255d77f08e60ee0808. How to fix ↓
Also tracked for
- tensorflow · Bitnami
- tensorflow · PyPI
- tensorflow · PyPI
- tensorflow-gpu · 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 various applications. It provides a comprehensive ecosystem of tools, libraries, and resources for developing and deploying machine learning models. The vulnerability affects the TensorFlow CPU package, specifically versions prior to 2.4.0. TensorFlow allows quantization and dequantization of tensors, which is a process of converting floating-point values to a lower precision representation. However, an attacker can exploit an issue in the tf.quantization.quantize_and_dequantize function by passing an invalid axis value. This leads to accessing a dimension outside the rank of the input tensor, resulting in a segmentation fault and out-of-bounds access in the C++ kernel implementation.
Vulnerability Detail
The vulnerability arises due to insufficient validation of the axis argument in the tf.quantization.quantize_and_dequantize function. By providing an invalid axis value, an attacker can trigger a segmentation fault and access elements outside the bounds of the array. This can potentially lead to arbitrary code execution or denial of service. The issue has been patched in TensorFlow commit eccb7ec454e6617738554a255d77f08e60ee0808, and the fix is included in TensorFlow version 2.4.0.
How To Fix
Latest published version: 2.21.0 as of 22 Oct 2026
pip install --upgrade "tensorflow-cpu==2.21.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-cpu==eccb7ec454e6617738554a255d77f08e60ee0808"
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
If immediate update is not possible, a temporary workaround is to avoid passing invalid axis values to the tf.quantization.quantize_and_dequantize function. Ensure that the axis value is within the valid range for the input tensor. Here is an example of how to validate the axis value before calling the function:
import tensorflow as tf
def safe_quantize_and_dequantize(tensor, axis):
if axis < 0 or axis >= len(tensor.shape):
raise ValueError('Invalid axis value')
return tf.quantization.quantize_and_dequantize(tensor, axis)
By implementing this validation, the vulnerability can be mitigated until the package is updated.
Conclusion
The vulnerability in TensorFlow CPU versions prior to 2.4.0 allows an attacker to trigger a segmentation fault and access elements outside the bounds of an array. To mitigate this issue, it is crucial to update the TensorFlow CPU package to version 2.4.0 or later. If immediate update is not feasible, implementing a validation check for the axis value can serve as a temporary workaround. For further assistance or support in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for tensorflow-cpu →
FAQ
TensorFlow is an open-source machine learning framework used for developing and deploying machine learning models. It provides a comprehensive set of tools, libraries, and resources for various applications.
The vulnerability allows an attacker to trigger a segmentation fault and potentially execute arbitrary code or cause a denial of service. It can be exploited by passing an invalid axis value to the tf.quantization.quantize_and_dequantize function.
The vulnerability affects TensorFlow CPU versions prior to 2.4.0. It is recommended to update to version 2.4.0 or later to mitigate the issue.
To fix the vulnerability, update the TensorFlow CPU package to version 2.4.0 or later. This can be done by upgrading the package using the package manager or manually installing the latest version from the official TensorFlow repository.
If immediate update is not possible, a temporary workaround is to validate the axis value before calling the tf.quantization.quantize_and_dequantize function. Ensure that the axis value is within the valid range for the input tensor.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow-cpu.