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 package | Versions | Reported by |
|---|---|---|
| tensorflow tensorflow | = 2.3.0 | CVE List |
| tensorflow (PyPI) | from 2.3.0 before 2.3.1, before 3cbb917b4714766030b28eba9fb41bb97ce9ee02, before 2.3.1 | GitHub Advisory Database, PyPA Advisory Database |
| tensorflow-cpu (PyPI) | from 2.3.0 before 2.3.1, before 3cbb917b4714766030b28eba9fb41bb97ce9ee02, before 2.3.1 | GitHub Advisory Database, PyPA Advisory Database |
| tensorflow-gpu (PyPI) | from 2.3.0 before 2.3.1, before 3cbb917b4714766030b28eba9fb41bb97ce9ee02, before 2.3.1 | GitHub Advisory Database, PyPA Advisory Database |
| google tensorflow | 2.3.0 | NVD |
| tensorflow (Bitnami) | from 2.3.0 before 2.3.1 | Bitnami Vulnerability Database |
All scores
| GitHub_M | 5.9medium CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H |
| GitHub | 5.9high CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H |
| GitHub | high CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N |
| NVD | 5.9medium CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | 4.3medium CVSS:2.0 | AV:N/AC:M/Au:N/C:N/I:N/A:P |
| Bitnami Vulnerability Database | medium 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. En particular, no existe comprobación de que los valores en el tensor "splits" generen una partición válida del tensor "values". Por lo tanto, el código establece las condiciones para causar un desbordamiento del búfer de la pila. Un "BatchedMap" es equivalente a un vector donde cada elemento es un mapa de hash. 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". Intentar acceder a eso en el código de usuario resulta en un fallo de segmentación. El problema es parcheado en el commit 3cbb917b4714766030b28eba9fb41bb97ce9ee02 y es publicado en TensorFlow versión 2.3.1
References
| https://github.com/tensorflow/tensorflow/releases/tag/v2.3.1 | advisory, third-party-advisory, web | |
| https://github.com/tensorflow/tensorflow/security/advisories/GHSA-x7rp-74x2-mjf3 | advisory, exploit, third-party-advisory, web | |
| https://github.com/tensorflow/tensorflow/commit/3cbb917b4714766030b28eba9fb41bb97ce9ee02 | advisory, fix, patch, third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2020-15200 | advisory, web | |
| https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-cpu/PYSEC-2020-280.yaml | web | |
| https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-gpu/PYSEC-2020-315.yaml | web | |
| https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow/PYSEC-2020-123.yaml | web | |
| https://github.com/tensorflow/tensorflow | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2020-15200 changed 2024-08-04 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-x7rp-74x2-mjf3 changed 2026-07-08 | CC-BY-4.0 |
| NVD | CVE-2020-15200 changed 2026-06-17 | Public domain |
| PyPA Advisory Database | PYSEC-2020-123 changed 2023-12-06 | CC-BY-4.0 |
| PyPA Advisory Database | PYSEC-2020-280 changed 2023-12-06 | CC-BY-4.0 |
| PyPA Advisory Database | PYSEC-2020-315 changed 2023-12-06 | CC-BY-4.0 |
| Bitnami Vulnerability Database | BIT-TENSORFLOW-2020-15200 changed 2026-09-08 | Apache-2.0 |