CVE-2020-15265 Segfault in Tensorflow
An attacker can cause a segmentation fault and denial of service in TensorFlow by passing an invalid axis value to the quantization function.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2020-15265?
CVE-2020-15265 is a medium-severity memory corruption vulnerability in Google Tensorflow, published on 21 Oct 2020. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
In Tensorflow before version 2.4.0, an attacker can pass an invalid `axis` value to `tf.quantization.quantize_and_dequantize`. This results in accessing a dimension outside the rank of the input tensor in the C++ kernel implementation. However, dim_size only does a DCHECK to validate the argument and then uses it to access the corresponding element of an array. Since in normal builds, `DCHECK`-like macros are no-ops, this results in segfault and access out of bounds of the array. The issue is patched in eccb7ec454e6617738554a255d77f08e60ee0808 and TensorFlow 2.4.0 will be released containing the patch. TensorFlow nightly packages after this commit will also have the issue resolved.
Weakness: CWE-125
Which versions are affected by CVE-2020-15265?
10 open source packages ship an affected version, including tensorflow, tensorflow-cpu and tensorflow-gpu. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
tensorflow Bitnami | All versions | 2.4.0 |
tensorflow PyPI | All versions | 2.4.0 |
tensorflow PyPI | All versions | 2.4.0 |
tensorflow PyPI | All versions | 2.4.0 |
tensorflow-cpu PyPI | All versions | 2.4.0 |
tensorflow-cpu PyPI | All versions | 2.4.0 |
4 more packages
tensorflow-cpu PyPI | All versions | 2.4.0 |
tensorflow-gpu PyPI | All versions | 2.4.0 |
tensorflow-gpu PyPI | All versions | 2.4.0 |
tensorflow-gpu PyPI | All versions | 2.4.0 |
Products include Google Tensorflow.
How do I fix CVE-2020-15265?
Upgrade tensorflow to 2.4.0 or later.
Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.
Is CVE-2020-15265 being exploited?
There is no known exploitation of CVE-2020-15265 in the wild and no public exploit code.
Other vulnerabilities in Google Tensorflow
- CVE-2023-25668 TensorFlow vulnerable to heap out-of-buffer read in the QuantizeAndDequantize operation
- CVE-2018-7575 Integer Overflow or Wraparound in Google TensorFlow
- CVE-2021-37678 Arbitrary code execution due to YAML deserialization
- CVE-2021-35958 Path traversal in n/a
- CVE-2020-15202 Integer truncation in Shard API usage
Sources
Also known as BIT-tensorflow-2020-15265, GHSA-rrfp-j2mp-hq9c, PYSEC-2020-138, PYSEC-2020-295, PYSEC-2020-330.