{"id":"CVE-2021-29554","published":"2021-05-14T19:10:15Z","modified":"2024-08-03T22:11:06Z","title":"Division by 0 in `DenseCountSparseOutput`","vendor":"tensorflow","product":"tensorflow","tier":"tail","description":{"text":"TensorFlow is an end-to-end open source platform for machine learning. An attacker can cause a denial of service via a FPE runtime error in `tf.raw_ops.DenseCountSparseOutput`. This is because the implementation(https://github.com/tensorflow/tensorflow/blob/efff014f3b2d8ef6141da30c806faf141297eca1/tensorflow/core/kernels/count_ops.cc#L123-L127) computes a divisor value from user data but does not check that the result is 0 before doing the division. Since `data` is given by the `values` argument, `num_batch_elements` is 0. The fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2, and TensorFlow 2.3.3, as these are also affected.","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.00189,"percentile":0.08716,"provenance":"source"},"cwes":[{"id":"CWE-369","name":"Divide By Zero"}],"references":[{"url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-qg48-85hg-mqc5","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/tensorflow/tensorflow/commit/da5ff2daf618591f64b2b62d9d9803951b945e9f","tags":["x_refsource_MISC"]}],"priority":{"score":3.5,"factors":[{"name":"EPSS percentile","points":1.74},{"name":"CVSS severity","points":1.75}]},"vendorSlug":"tensorflow","affectedVersions":[{"vendor":"tensorflow","product":"tensorflow","versions":["< 2.3.3",">= 2.4.0, < 2.4.2"]}],"affected":[{"ecosystem":"PyPI","package":"tensorflow","vulnerableRanges":[">=2.3.0, <2.3.3",">=2.4.0, <2.4.2","<2.1.4",">=2.2.0, <2.2.3"],"patched":["2.3.3","2.4.2","2.1.4","2.2.3"],"from":["GHSA-qg48-85hg-mqc5","PYSEC-2021-191"],"provenance":"source"},{"ecosystem":"PyPI","package":"tensorflow-cpu","vulnerableRanges":[">=2.3.0, <2.3.3",">=2.4.0, <2.4.2","<2.1.4",">=2.2.0, <2.2.3"],"patched":["2.3.3","2.4.2","2.1.4","2.2.3"],"from":["GHSA-qg48-85hg-mqc5","PYSEC-2021-482"],"provenance":"source"},{"ecosystem":"PyPI","package":"tensorflow-gpu","vulnerableRanges":[">=2.3.0, <2.3.3",">=2.4.0, <2.4.2","<2.1.4",">=2.2.0, <2.2.3"],"patched":["2.3.3","2.4.2","2.1.4","2.2.3"],"from":["GHSA-qg48-85hg-mqc5","PYSEC-2021-680"],"provenance":"source"}],"summary":{"text":"The flaw is a divide-by-zero in the DenseCountSparseOutput operation of TensorFlow, where a divisor computed from user-supplied input is used without first checking that it is non-zero. An attacker who can invoke this operation with crafted values input and only local access, with low privileges and a high-complexity condition, can crash the process to cause a denial of service.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:23:09Z"},"euvd":{"id":"EUVD-2021-0295","exploited":false,"provenance":"source"}}