CVE-2020-26269: Tensorflow TensorFlow Vulnerable To Heap Out Vulnerability
HIGHCVE-2020-26269 is a HIGH (CVSS 9.1) tensorflow vulnerable to heap out vulnerability (CWE-125: Out-of-bounds Read) affecting Tensorflow libraries in the PyPI ecosystem. The issue involves tensorflow vulnerable to heap out of bounds read in filesystem glob matching. Remediation is available by upgrading affected packages to version 2.4.0.
CVE-2020-26269 at a Glance
Security Impact
CVSS: 9.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H).
How to Fix CVE-2020-26269
To remediate this vulnerability, upgrade all affected Tensorflow dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install tensorflow>=2.4.0
pip install tensorflow-cpu>=2.4.0
pip install tensorflow-gpu>=2.4.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show tensorflow
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2020-26269, inspect your installed packages using pip:
pip show tensorflow
Analyze the terminal output to locate any version of Tensorflow in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.4.0), your application is affected.
Note: The pip show tensorflow command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-125: Out-of-bounds Read, where the product reads data past the end, or before the beginning, of the intended buffer. In Tensorflow, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2020-26269 Affected Tensorflow Versions
3 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
tensorflow
|
PyPI |
≥ 2.4.0rc0
< 2.4.0
|
2.4.0
|
|
tensorflow-cpu
|
PyPI |
≥ 2.4.0rc0
< 2.4.0
|
2.4.0
|
|
tensorflow-gpu
|
PyPI |
≥ 2.4.0rc0
< 2.4.0
|
2.4.0
|
References
Frequently Asked Questions
What is CVE-2020-26269?
Which Tensorflow versions are affected?
What version fixes CVE-2020-26269?
Is tensorflow affected?
Is tensorflow-cpu affected?
What is the CVSS score of CVE-2020-26269?
What CWE is associated with CVE-2020-26269?
How can I check PyPI dependencies for CVE-2020-26269?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-9jjw-hf72-3mxw",
"modified" : "2024-10-30T21:23:20Z",
"published" : "2022-10-07T07:22:33Z",
"aliases" : [ "CVE-2020-26269" ],
"summary" : "TensorFlow vulnerable to heap out of bounds read in filesystem glob matching",
"details" : "### Impact\nThe general implementation for matching filesystem paths to globbing pattern is vulnerable to an access out of bounds of [the array holding the directories](https://github.com/tensorflow/tensorflow/blob/458c6260265c46ebaf18052d6c61aea4b6b40926/tensorflow/core/platform/file_system_helper.cc#L127):\n\n```cc\nif (!fs->Match(child_path, dirs[dir_index])) { ... }\n```\n\nSince `dir_index` is [unconditionaly incremented](https://github.com/tensorflow/tensorflow/blob/458c6260265c46ebaf18052d6c61aea4b6b40926/tensorflow/core/platform/file_system_helper.cc#L106) 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:\n\n```python\n>>> tf.io.gfile.glob('/tmp/x/')\nSegmentation fault\n```\n\nThere are multiple invariants and preconditions that are assumed by the parallel implementation of `GetMatchingPaths` but are not verified by the PRs introducing it ([#40861](https://github.com/tensorflow/tensorflow/pull/40861) and [#44310](https://github.com/tensorflow/tensorflow/pull/44310)). Thus, we are completely rewriting the implementation to fully specify and validate these.\n\n### Patches\nWe have patched the issue in GitHub commit [8b5b9dc96666a3a5d27fad7179ff215e3b74b67c](https://github.com/tensorflow/tensorflow/commit/8b5b9dc96666a3a5d27fad7179ff215e3b74b67c) and will release TensorFlow 2.4.0 containing the patch. TensorFlow nightly packages after this commit will also have the issue resolved.\n\nThis 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.\n\n### For more information\nPlease consult [our security guide](https://github.com/tensorflow/tensorflow/blob/master/SECURITY.md) for more information regarding the security model and how to contact us with issues and questions.\n\n### Attribution\nThis vulnerability has been reported by members of the Aivul Team from Qihoo 360.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H"
}, {
"type" : "CVSS_V4",
"score" : "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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "tensorflow"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.4.0rc0"
}, {
"fixed" : "2.4.0"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "tensorflow-cpu"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.4.0rc0"
}, {
"fixed" : "2.4.0"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "tensorflow-gpu"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.4.0rc0"
}, {
"fixed" : "2.4.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/tensorflow/tensorflow/security/advisories/GHSA-9jjw-hf72-3mxw"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-26269"
}, {
"type" : "WEB",
"url" : "https://github.com/tensorflow/tensorflow/pull/40861"
}, {
"type" : "WEB",
"url" : "https://github.com/tensorflow/tensorflow/pull/44310"
}, {
"type" : "WEB",
"url" : "https://github.com/tensorflow/tensorflow/commit/8b5b9dc96666a3a5d27fad7179ff215e3b74b67c"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-cpu/PYSEC-2020-300.yaml"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-gpu/PYSEC-2020-335.yaml"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow/PYSEC-2020-141.yaml"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/tensorflow/tensorflow"
}, {
"type" : "WEB",
"url" : "https://github.com/tensorflow/tensorflow/blob/458c6260265c46ebaf18052d6c61aea4b6b40926/tensorflow/core/platform/file_system_helper.cc#L106"
}, {
"type" : "WEB",
"url" : "https://github.com/tensorflow/tensorflow/blob/458c6260265c46ebaf18052d6c61aea4b6b40926/tensorflow/core/platform/file_system_helper.cc#L127"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-125" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-10-07T07:22:33Z",
"nvd_published_at" : "2020-12-10T23:15:00Z"
}
}