{"id":"CVE-2021-29586","published":"2021-05-14T19:35:25Z","modified":"2024-08-03T22:11:06Z","title":"Division by zero in optimized pooling implementations in TFLite","vendor":"tensorflow","product":"tensorflow","tier":"tail","description":{"text":"TensorFlow is an end-to-end open source platform for machine learning. Optimized pooling implementations in TFLite fail to check that the stride arguments are not 0 before calling `ComputePaddingHeightWidth`(https://github.com/tensorflow/tensorflow/blob/3f24ccd932546416ec906a02ddd183b48a1d2c83/tensorflow/lite/kernels/pooling.cc#L90). Since users can craft special models which will have `params->stride_{height,width}` be zero, this will result in a division by zero. 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.10189,"provenance":"source"},"cwes":[{"id":"CWE-369","name":"Divide By Zero"}],"references":[{"url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-26j7-6w8w-7922","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/tensorflow/tensorflow/commit/5f7975d09eac0f10ed8a17dbb6f5964977725adc","tags":["x_refsource_MISC"]}],"priority":{"score":3.8,"factors":[{"name":"EPSS percentile","points":2.04},{"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"],"patched":["2.1.4","2.2.3","2.3.3","2.4.2"],"from":["GHSA-26j7-6w8w-7922","PYSEC-2021-223"],"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"],"patched":["2.1.4","2.2.3","2.3.3","2.4.2"],"from":["GHSA-26j7-6w8w-7922","PYSEC-2021-514"],"provenance":"source"},{"ecosystem":"PyPI","package":"tensorflow-gpu","vulnerableRanges":["<2.1.4",">=2.2.0, <2.2.3",">=2.3.0, <2.3.3",">=2.4.0, <2.4.2"],"patched":["2.1.4","2.2.3","2.3.3","2.4.2"],"from":["GHSA-26j7-6w8w-7922","PYSEC-2021-712"],"provenance":"source"}],"summary":{"text":"The flaw is a division by zero in the optimized pooling implementations of TensorFlow Lite, part of the TensorFlow product, where the stride arguments are not checked for zero before being passed to ComputePaddingHeightWidth. An attacker with local access and low privileges, who is not required to take any user interaction, can supply a specially crafted model whose stride height or width is zero, causing a division by zero that can crash the process (availability impact).","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:22:50Z"},"euvd":{"id":"EUVD-2021-0327","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-tensorflow-cve-2021-29586","children":[{"from":"CVE-2021-29586","to":"CVE-2021-37686","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["tensorflow/lite/kernels/pooling.cc"],"commits":["https://github.com/tensorflow/tensorflow/commit/5f7975d09eac0f10ed8a17dbb6f5964977725adc","https://github.com/tensorflow/tensorflow/commit/dfa22b348b70bb89d6d6ec0ff53973bacb4f4695"],"basis":"shared function","functions":["GenericPrepare"]}]}]}}