7.5high
Heap out of bounds read in filesystem glob matching in TensorFlow
- Severity
- 7.5high CVSS:3.1 by NVD
- Exploit likelihood
- 0.70% (higher than 54% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-9jjw-hf72-3mxwBIT-TENSORFLOW-2020-26269PYSEC-2020-141PYSEC-2020-300PYSEC-2020-335
Description
In TensorFlow release candidate versions 2.4.0rc*, the general implementation for matching filesystem paths to globbing pattern is vulnerable to an access out of bounds of the array holding the directories. There are multiple invariants and preconditions that are assumed by the parallel implementation of GetMatchingPaths but are not verified by the PRs introducing it (#40861 and #44310). Thus, we are completely rewriting the implementation to fully specify and validate these. This is patched in version 2.4.0. This issue only impacts master branch and the release candidates for TF version 2.4. The final release of the 2.4 release will be patched.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| tensorflow tensorflow | .4.0rc* | CVE List |
| tensorflow (PyPI) | from 2.4.0rc0 before 2.4.0, before 8b5b9dc96666a3a5d27fad7179ff215e3b74b67c | GitHub Advisory Database, PyPA Advisory Database |
| tensorflow-cpu (PyPI) | from 2.4.0rc0 before 2.4.0, before 8b5b9dc96666a3a5d27fad7179ff215e3b74b67c | GitHub Advisory Database, PyPA Advisory Database |
| tensorflow-gpu (PyPI) | from 2.4.0rc0 before 2.4.0, before 8b5b9dc96666a3a5d27fad7179ff215e3b74b67c | GitHub Advisory Database, PyPA Advisory Database |
| google tensorflow | 2.4.0 | NVD |
| tensorflow (Bitnami) | from 2.4.0-rc0 before 2.4.0, from 2.4.0-rc1 before 2.4.0, from 2.4.0-rc2 before 2.4.0, from 2.4.0-rc3 before 2.4.0, from 2.4.0-rc4 before 2.4.0 | Bitnami Vulnerability Database |
All scores
| GitHub | 9.1high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H |
| GitHub | high CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:N/VA:H/SC:N/SI:N/SA:N |
| NVD | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | 5.0medium CVSS:2.0 | AV:N/AC:L/Au:N/C:N/I:N/A:P |
| Bitnami Vulnerability Database | high rating |
Classification
What each source says
CVE List
In TensorFlow release candidate versions 2.4.0rc*, the general implementation for matching filesystem paths to globbing pattern is vulnerable to an access out of bounds of the array holding the directories. There are multiple invariants and preconditions that are assumed by the parallel implementation of GetMatchingPaths but are not verified by the PRs introducing it (#40861 and #44310). Thus, we are completely rewriting the implementation to fully specify and validate these. This is patched in version 2.4.0. This issue only impacts master branch and the release candidates for TF version 2.4. The final release of the 2.4 release will be patched.
GitHub Advisory Database
Impact
The general implementation for matching filesystem paths to globbing pattern is vulnerable to an access out of bounds of the array holding the directories:
if (!fs->Match(child_path, dirs[dir_index])) { ... }
Since dir_index is unconditionaly incremented outside of the lambda function where the vulnerable pattern occurs, this results in an access out of bounds issue under certain scenarios. For example, if /tmp/x is a directory that only contains a single file y, then the following scenario will cause a crash due to the out of bounds read:
>>> tf.io.gfile.glob('/tmp/x/')
Segmentation fault
There are multiple invariants and preconditions that are assumed by the parallel implementation of GetMatchingPaths but are not verified by the PRs introducing it (#40861 and #44310). Thus, we are completely rewriting the implementation to fully specify and validate these.
Patches
We have patched the issue in GitHub commit 8b5b9dc96666a3a5d27fad7179ff215e3b74b67c and will release TensorFlow 2.4.0 containing the patch. TensorFlow nightly packages after this commit will also have the issue resolved.
This issue only impacts master branch and the release candidates for TF version 2.4. The final release of the 2.4 release will be patched.
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 has been reported by members of the Aivul Team from Qihoo 360.
NVD (es)
En las versiones candidatas a lanzamiento de TensorFlow 2.4.0rc*, la implementación general para hacer coincidir las rutas del sistema de archivos con el patrón globbing es vulnerable a un acceso fuera de límites de la matriz que contiene los directorios. Existen múltiples invariantes y condiciones previas que son asumidas por la implementación paralela de GetMatchingPaths pero no son verificadas por los RP que lo presentan (#40861 y #44310). Por lo tanto, estamos reescribiendo completamente la implementación para especificarlos y validarlos completamente. Esto está parcheado en la versión 2.4.0. Este problema solo afecta a la rama maestra y a los candidatas de lanzamiento para TF versión 2.4. La versión final de la versión 2.4 será parcheada.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2020-26269 changed 2024-08-04 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-9jjw-hf72-3mxw changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2020-26269 changed 2026-06-17 | Public domain |
| PyPA Advisory Database | PYSEC-2020-141 changed 2023-12-06 | CC-BY-4.0 |
| PyPA Advisory Database | PYSEC-2020-300 changed 2023-12-06 | CC-BY-4.0 |
| PyPA Advisory Database | PYSEC-2020-335 changed 2023-12-06 | CC-BY-4.0 |
| Bitnami Vulnerability Database | BIT-TENSORFLOW-2020-26269 changed 2025-05-20 | Apache-2.0 |