CVE-2020-15200
JSON

5.9medium

Segfault in Tensorflow

Severity
5.9medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.85% (higher than 56% of CVEs)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-x7rp-74x2-mjf3BIT-TENSORFLOW-2020-15200PYSEC-2020-123PYSEC-2020-280PYSEC-2020-315

Description

In Tensorflow before version 2.3.1, the `RaggedCountSparseOutput` implementation does not validate that the input arguments form a valid ragged tensor. In particular, there is no validation that the values in the `splits` tensor generate a valid partitioning of the `values` tensor. Thus, the code sets up conditions to cause a heap buffer overflow. A `BatchedMap` is equivalent to a vector where each element is a hashmap. However, if the first element of `splits_values` is not 0, `batch_idx` will never be 1, hence there will be no hashmap at index 0 in `per_batch_counts`. Trying to access that in the user code results in a segmentation fault. The issue is patched in commit 3cbb917b4714766030b28eba9fb41bb97ce9ee02 and is released in TensorFlow version 2.3.1.

Affected

Product or packageVersionsReported by
tensorflow tensorflow= 2.3.0CVE List
tensorflow (PyPI)from 2.3.0 before 2.3.1, before 3cbb917b4714766030b28eba9fb41bb97ce9ee02, before 2.3.1GitHub Advisory Database, PyPA Advisory Database
tensorflow-cpu (PyPI)from 2.3.0 before 2.3.1, before 3cbb917b4714766030b28eba9fb41bb97ce9ee02, before 2.3.1GitHub Advisory Database, PyPA Advisory Database
tensorflow-gpu (PyPI)from 2.3.0 before 2.3.1, before 3cbb917b4714766030b28eba9fb41bb97ce9ee02, before 2.3.1GitHub Advisory Database, PyPA Advisory Database
google tensorflow2.3.0NVD
tensorflow (Bitnami)from 2.3.0 before 2.3.1Bitnami Vulnerability Database

All scores

GitHub_M5.9medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
GitHub5.9high CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
GitHubhigh CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
NVD5.9medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
NVD4.3medium CVSS:2.0AV:N/AC:M/Au:N/C:N/I:N/A:P
Bitnami Vulnerability Databasemedium rating

Classification

What each source says

CVE List

In Tensorflow before version 2.3.1, the `RaggedCountSparseOutput` implementation does not validate that the input arguments form a valid ragged tensor. In particular, there is no validation that the values in the `splits` tensor generate a valid partitioning of the `values` tensor. Thus, the code sets up conditions to cause a heap buffer overflow. A `BatchedMap` is equivalent to a vector where each element is a hashmap. However, if the first element of `splits_values` is not 0, `batch_idx` will never be 1, hence there will be no hashmap at index 0 in `per_batch_counts`. Trying to access that in the user code results in a segmentation fault. The issue is patched in commit 3cbb917b4714766030b28eba9fb41bb97ce9ee02 and is released in TensorFlow version 2.3.1.

GitHub Advisory Database
Impact

The RaggedCountSparseOutput implementation does not validate that the input arguments form a valid ragged tensor. In particular, there is no validation that the values in the splits tensor generate a valid partitioning of the values tensor. Thus, the following code sets up conditions to cause a heap buffer overflow:

    auto per_batch_counts = BatchedMap<W>(num_batches);
    int batch_idx = 0;
    for (int idx = 0; idx < num_values; ++idx) {
      while (idx >= splits_values(batch_idx)) {
        batch_idx++;
      }
      const auto& value = values_values(idx);
      if (value >= 0 && (maxlength_ <= 0 || value < maxlength_)) {
        per_batch_counts[batch_idx - 1][value] = 1;
      }
    }

A BatchedMap is equivalent to a vector where each element is a hashmap. However, if the first element of splits_values is not 0, batch_idx will never be 1, hence there will be no hashmap at index 0 in per_batch_counts. Trying to access that in the user code results in a segmentation fault.

Patches

We have patched the issue in 3cbb917b4714766030b28eba9fb41bb97ce9ee02 and will release a patch release.

We recommend users to upgrade to TensorFlow 2.3.1.

For more information

Please consult our security guide for more information regarding the security model and how to contact us with issues and questions.

Attribution

This vulnerability is a variant of GHSA-p5f8-gfw5-33w4

NVD (es)

En Tensorflow anteriores a la versión 2.3.1, la implementación de "RaggedCountSparseOutput" no comprueba que los argumentos de entrada formen un tensor irregular válido.&#xa0;En particular, no existe comprobación de que los valores en el tensor "splits" generen una partición válida del tensor "values".&#xa0;Por lo tanto, el código establece las condiciones para causar un desbordamiento del búfer de la pila.&#xa0;Un "BatchedMap" es equivalente a un vector donde cada elemento es un mapa de hash.&#xa0;Sin embargo, si el primer elemento de "splits_values" no es 0, "batch_idx" nunca será 1, por lo que no habrá un hashmap en el índice 0 en "per_batch_counts".&#xa0;Intentar acceder a eso en el código de usuario resulta en un fallo de segmentación.&#xa0;El problema es parcheado en el commit 3cbb917b4714766030b28eba9fb41bb97ce9ee02 y es publicado en TensorFlow versión 2.3.1

References

Sources

SourceRecordLicence
CVE ListCVE-2020-15200 changed 2024-08-04CVE Terms of Use
GitHub Advisory DatabaseGHSA-x7rp-74x2-mjf3 changed 2026-07-08CC-BY-4.0
NVDCVE-2020-15200 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2020-123 changed 2023-12-06CC-BY-4.0
PyPA Advisory DatabasePYSEC-2020-280 changed 2023-12-06CC-BY-4.0
PyPA Advisory DatabasePYSEC-2020-315 changed 2023-12-06CC-BY-4.0
Bitnami Vulnerability DatabaseBIT-TENSORFLOW-2020-15200 changed 2026-09-08Apache-2.0