{"id":"CVE-2021-37659","published":"2021-08-12T20:25:17Z","modified":"2024-08-04T01:23:01Z","title":"Out of bounds read via null pointer dereference in TensorFlow","vendor":"tensorflow","product":"tensorflow","tier":"tail","description":{"text":"TensorFlow is an end-to-end open source platform for machine learning. In affected versions an attacker can cause undefined behavior via binding a reference to null pointer in all binary cwise operations that don't require broadcasting (e.g., gradients of binary cwise operations). The [implementation](https://github.com/tensorflow/tensorflow/blob/84d053187cb80d975ef2b9684d4b61981bca0c41/tensorflow/core/kernels/cwise_ops_common.h#L264) assumes that the two inputs have exactly the same number of elements but does not check that. Hence, when the eigen functor executes it triggers heap OOB reads and undefined behavior due to binding to nullptr. We have patched the issue in GitHub commit 93f428fd1768df147171ed674fee1fc5ab8309ec. The fix will be included in TensorFlow 2.6.0. We will also cherrypick this commit on TensorFlow 2.5.1, TensorFlow 2.4.3, and TensorFlow 2.3.4, as these are also affected and still in supported range.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.3,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00176,"percentile":0.04277,"provenance":"source"},"cwes":[{"id":"CWE-476","name":"NULL Pointer Dereference"},{"id":"CWE-125","name":"Out-of-bounds Read"}],"references":[{"url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-q3g3-h9r4-prrc","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/tensorflow/tensorflow/commit/93f428fd1768df147171ed674fee1fc5ab8309ec","tags":["x_refsource_MISC"]}],"priority":{"score":6.0,"factors":[{"name":"EPSS percentile","points":0.86},{"name":"CVSS severity","points":5.11}]},"vendorSlug":"tensorflow","affectedVersions":[{"vendor":"tensorflow","product":"tensorflow","versions":[">= 2.5.0, < 2.5.1",">= 2.4.0, < 2.4.3","< 2.3.4"]}],"affected":[{"ecosystem":"PyPI","package":"tensorflow","vulnerableRanges":["<2.3.4",">=2.4.0, <2.4.3",">=2.5.0, <2.5.1",">=2.3.0, <2.3.4"],"patched":["2.3.4","2.4.3","2.5.1"],"from":["GHSA-q3g3-h9r4-prrc","PYSEC-2021-281"],"provenance":"source"},{"ecosystem":"PyPI","package":"tensorflow-cpu","vulnerableRanges":["<2.3.4",">=2.4.0, <2.4.3",">=2.5.0, <2.5.1",">=2.3.0, <2.3.4"],"patched":["2.3.4","2.4.3","2.5.1"],"from":["GHSA-q3g3-h9r4-prrc","PYSEC-2021-572"],"provenance":"source"},{"ecosystem":"PyPI","package":"tensorflow-gpu","vulnerableRanges":["<2.3.4",">=2.4.0, <2.4.3",">=2.5.0, <2.5.1",">=2.3.0, <2.3.4"],"patched":["2.3.4","2.4.3","2.5.1"],"from":["GHSA-q3g3-h9r4-prrc","PYSEC-2021-770"],"provenance":"source"}],"summary":{"text":"The flaw is an out-of-bounds read caused by a null pointer dereference in TensorFlow's binary element-wise (cwise) operations, which do not require broadcasting, such as gradients of binary cwise operations. An attacker with local access and low privileges can trigger heap out-of-bounds reads and undefined behavior by supplying inputs with mismatched element counts, since the implementation does not check that the two inputs have the same number of elements and user interaction is not required.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:15:20Z"},"euvd":{"id":"EUVD-2021-0385","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-tensorflow-cve-2021-37659","children":[{"from":"CVE-2021-37659","to":"CVE-2022-23583","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["tensorflow/core/kernels/cwise_ops_common.h"],"commits":["https://github.com/tensorflow/tensorflow/commit/93f428fd1768df147171ed674fee1fc5ab8309ec","https://github.com/tensorflow/tensorflow/commit/a7c02f1a9bbc35473969618a09ee5f9f5d3e52d9"],"basis":"rarely changed file"}]},{"from":"CVE-2021-37659","to":"CVE-2022-41887","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["tensorflow/core/kernels/cwise_ops_common.h"],"commits":["https://github.com/tensorflow/tensorflow/commit/93f428fd1768df147171ed674fee1fc5ab8309ec","https://github.com/tensorflow/tensorflow/commit/c5b30379ba87cbe774b08ac50c1f6d36df4ebb7c"],"basis":"rarely changed file"}]}]}}