{"id":"CVE-2021-37655","published":"2021-08-12T20:25:10Z","modified":"2024-08-04T01:23:01Z","title":"Heap OOB in `ResourceScatterUpdate` 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 trigger a read from outside of bounds of heap allocated data by sending invalid arguments to `tf.raw_ops.ResourceScatterUpdate`. The [implementation](https://github.com/tensorflow/tensorflow/blob/f24faa153ad31a4b51578f8181d3aaab77a1ddeb/tensorflow/core/kernels/resource_variable_ops.cc#L919-L923) has an incomplete validation of the relationship between the shapes of `indices` and `updates`: instead of checking that the shape of `indices` is a prefix of the shape of `updates` (so that broadcasting can happen), code only checks that the number of elements in these two tensors are in a divisibility relationship. We have patched the issue in GitHub commit 01cff3f986259d661103412a20745928c727326f. 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.00167,"percentile":0.06113,"provenance":"source"},"cwes":[{"id":"CWE-125","name":"Out-of-bounds Read"}],"references":[{"url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-7fvx-3jfc-2cpc","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/tensorflow/tensorflow/commit/01cff3f986259d661103412a20745928c727326f","tags":["x_refsource_MISC"]}],"priority":{"score":6.3,"factors":[{"name":"EPSS percentile","points":1.22},{"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-7fvx-3jfc-2cpc","PYSEC-2021-277"],"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-7fvx-3jfc-2cpc","PYSEC-2021-568"],"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-7fvx-3jfc-2cpc","PYSEC-2021-766"],"provenance":"source"}],"summary":{"text":"The flaw is an out-of-bounds read on the heap in the ResourceScatterUpdate operation of TensorFlow, caused by incomplete validation of the shapes of indices and updates in its resource variable kernel. An attacker who can run TensorFlow operations locally, with low privileges, can trigger the read by supplying invalid arguments to tf.raw_ops.ResourceScatterUpdate, with no user interaction required.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:15:55Z"},"euvd":{"id":"EUVD-2021-0381","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-tensorflow-cve-2021-37642","parents":[{"from":"CVE-2021-37642","to":"CVE-2021-37655","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["tensorflow/core/kernels/resource_variable_ops.cc"],"commits":["https://github.com/tensorflow/tensorflow/commit/4aacb30888638da75023e6601149415b39763d76","https://github.com/tensorflow/tensorflow/commit/01cff3f986259d661103412a20745928c727326f"],"basis":"shared function","functions":["ResourceScatterUpdateOp"]}]}]}}