{"id":"CVE-2021-37668","published":"2021-08-12T22:30:12Z","modified":"2024-08-04T01:23:01Z","title":"Division by zero in TensorFlow Lite `tf.raw_ops.UnravelIndex`","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 denial of service in applications serving models using `tf.raw_ops.UnravelIndex` by triggering a division by 0. The [implementation](https://github.com/tensorflow/tensorflow/blob/460e000de3a83278fb00b61a16d161b1964f15f4/tensorflow/core/kernels/unravel_index_op.cc#L36) does not check that the tensor subsumed by `dims` is not empty. Hence, if one element of `dims` is 0, the implementation does a division by 0. We have patched the issue in GitHub commit a776040a5e7ebf76eeb7eb923bf1ae417dd4d233. 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.00158,"percentile":0.05091,"provenance":"source"},"cwes":[{"id":"CWE-369","name":"Divide By Zero"}],"references":[{"url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-2wmv-37vq-52g5","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/tensorflow/tensorflow/commit/a776040a5e7ebf76eeb7eb923bf1ae417dd4d233","tags":["x_refsource_MISC"]}],"priority":{"score":4.9,"factors":[{"name":"EPSS percentile","points":1.02},{"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-2wmv-37vq-52g5","PYSEC-2021-290"],"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-2wmv-37vq-52g5","PYSEC-2021-581"],"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-2wmv-37vq-52g5","PYSEC-2021-779"],"provenance":"source"}],"summary":{"text":"The flaw is a division-by-zero bug in the tf.raw_ops.UnravelIndex operation of TensorFlow (TensorFlow Lite is not the affected component named here; the product is TensorFlow), where the kernel does not check that the dims tensor is non-empty before dividing. An attacker who can supply input to an application serving a model that uses this operation, with local access and low privileges, can trigger a division by zero to crash the process and cause a denial of service, with no user interaction required.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:20:39Z"},"euvd":{"id":"EUVD-2021-0394","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-tensorflow-cve-2021-37668","children":[{"from":"CVE-2021-37668","to":"CVE-2022-21729","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["tensorflow/core/kernels/unravel_index_op.cc"],"commits":["https://github.com/tensorflow/tensorflow/commit/a776040a5e7ebf76eeb7eb923bf1ae417dd4d233","https://github.com/tensorflow/tensorflow/commit/58b34c6c8250983948b5a781b426f6aa01fd47af"],"basis":"shared function","functions":["UnravelIndexOp"]}]}]}}