{"id":"CVE-2021-29589","published":"2021-05-14T19:22:39Z","modified":"2024-08-03T22:11:06Z","title":"Division by zero in TFLite's implementation of `GatherNd`","vendor":"tensorflow","product":"tensorflow","tier":"tail","description":{"text":"TensorFlow is an end-to-end open source platform for machine learning. The reference implementation of the `GatherNd` TFLite operator is vulnerable to a division by zero error(https://github.com/tensorflow/tensorflow/blob/0d45ea1ca641b21b73bcf9c00e0179cda284e7e7/tensorflow/lite/kernels/internal/reference/reference_ops.h#L966). An attacker can craft a model such that `params` input would be an empty tensor. In turn, `params_shape.Dims(.)` would be zero, in at least one dimension. The fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2, TensorFlow 2.3.3, TensorFlow 2.2.3 and TensorFlow 2.1.4, as these are also affected and still in supported range.","provenance":"source","from":"CVE.org"},"cvss":{"score":2.5,"severity":"LOW","version":"3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:L","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00201,"percentile":0.05698,"provenance":"source"},"cwes":[{"id":"CWE-369","name":"Divide By Zero"}],"references":[{"url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-3w67-q784-6w7c","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/tensorflow/tensorflow/commit/8e45822aa0b9f5df4b4c64f221e64dc930a70a9d","tags":["x_refsource_MISC"]}],"priority":{"score":2.9,"factors":[{"name":"EPSS percentile","points":1.14},{"name":"CVSS severity","points":1.75}]},"vendorSlug":"tensorflow","affectedVersions":[{"vendor":"tensorflow","product":"tensorflow","versions":["< 2.1.4",">= 2.2.0, < 2.2.3",">= 2.3.0, < 2.3.3",">= 2.4.0, < 2.4.2"]}],"affected":[{"ecosystem":"PyPI","package":"tensorflow","vulnerableRanges":["<2.1.4",">=2.2.0, <2.2.3",">=2.3.0, <2.3.3",">=2.4.0, <2.4.2","<2.2.0rc0",">=2.2.0, <2.3.0rc0",">=2.3.0, <2.3.4",">=2.4.0, <2.4.3"],"patched":["2.1.4","2.2.3","2.3.3","2.4.2","2.2.0rc0","2.3.0rc0","2.3.4","2.4.3"],"from":["GHSA-3w67-q784-6w7c","PYSEC-2021-226"],"provenance":"source"},{"ecosystem":"PyPI","package":"tensorflow-cpu","vulnerableRanges":["<2.1.4",">=2.2.0, <2.2.3",">=2.3.0, <2.3.3",">=2.4.0, <2.4.2","<2.2.0rc0",">=2.2.0, <2.3.0rc0",">=2.3.0, <2.3.4",">=2.4.0, <2.4.3"],"patched":["2.1.4","2.2.3","2.3.3","2.4.2","2.2.0rc0","2.3.0rc0","2.3.4","2.4.3"],"from":["GHSA-3w67-q784-6w7c","PYSEC-2021-517"],"provenance":"source"},{"ecosystem":"PyPI","package":"tensorflow-gpu","vulnerableRanges":["<2.1.4",">=2.2.0, <2.2.3",">=2.4.0, <2.4.2",">=2.3.0, <2.3.3","<2.2.0rc0",">=2.2.0, <2.3.0rc0",">=2.3.0, <2.3.4",">=2.4.0, <2.4.3"],"patched":["2.1.4","2.2.3","2.4.2","2.3.3","2.2.0rc0","2.3.0rc0","2.3.4","2.4.3"],"from":["GHSA-3w67-q784-6w7c","PYSEC-2021-715"],"provenance":"source"}],"summary":{"text":"A division-by-zero flaw exists in the reference implementation of the GatherNd operator in TensorFlow's TFLite kernels (reference_ops.h), in the tensorflow product. An attacker who can supply a crafted model with an empty params tensor triggers the error, which requires local access and low privileges, with the attacker needing to get the model loaded and executed without any user interaction.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:22:50Z"},"euvd":{"id":"EUVD-2021-0330","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-tensorflow-cve-2021-29589","children":[{"from":"CVE-2021-29589","to":"CVE-2021-37687","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["tensorflow/lite/kernels/gather_nd.cc"],"commits":["https://github.com/tensorflow/tensorflow/commit/8e45822aa0b9f5df4b4c64f221e64dc930a70a9d","https://github.com/tensorflow/tensorflow/commit/bb6a0383ed553c286f87ca88c207f6774d5c4a8f","https://github.com/tensorflow/tensorflow/commit/eb921122119a6b6e470ee98b89e65d721663179d"],"basis":"rarely changed file"}]},{"from":"CVE-2021-29589","to":"CVE-2022-35937","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["tensorflow/lite/kernels/gather_nd.cc"],"commits":["https://github.com/tensorflow/tensorflow/commit/8e45822aa0b9f5df4b4c64f221e64dc930a70a9d","https://github.com/tensorflow/tensorflow/commit/595a65a3e224a0362d7e68c2213acfc2b499a196"],"basis":"rarely changed file"}]}]}}