{"id":"CVE-2021-37642","published":"2021-08-12T17:35:16Z","modified":"2024-08-04T01:23:01Z","title":"Division by 0 in `ResourceScatterDiv` 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 the implementation of `tf.raw_ops.ResourceScatterDiv` is vulnerable to a division by 0 error. The [implementation](https://github.com/tensorflow/tensorflow/blob/8d72537c6abf5a44103b57b9c2e22c14f5f49698/tensorflow/core/kernels/resource_variable_ops.cc#L865) uses a common class for all binary operations but fails to treat the division by 0 case separately. We have patched the issue in GitHub commit 4aacb30888638da75023e6601149415b39763d76. 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":5.5,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00152,"percentile":0.04439,"provenance":"source"},"cwes":[{"id":"CWE-369","name":"Divide By Zero"}],"references":[{"url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-ch4f-829c-v5pw","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/tensorflow/tensorflow/commit/4aacb30888638da75023e6601149415b39763d76","tags":["x_refsource_MISC"]}],"priority":{"score":4.7,"factors":[{"name":"EPSS percentile","points":0.89},{"name":"CVSS severity","points":3.85}]},"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-ch4f-829c-v5pw","PYSEC-2021-264"],"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-ch4f-829c-v5pw","PYSEC-2021-555"],"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-ch4f-829c-v5pw","PYSEC-2021-753"],"provenance":"source"}],"summary":{"text":"The division-by-zero flaw lives in TensorFlow's tf.raw_ops.ResourceScatterDiv operation, in the binary-operation implementation shared by all such operations in its resource variable kernels, which does not handle a zero divisor as a separate case. An attacker who can run TensorFlow operations locally (with low privileges, and without needing user interaction) can trigger the division by zero to crash the process, causing a denial of service.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:20:38Z"},"euvd":{"id":"EUVD-2021-0368","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-tensorflow-cve-2021-37642","children":[{"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"]}]}]}}