{"id":"CVE-2021-29549","published":"2021-05-14T19:10:41Z","modified":"2024-08-03T22:11:05Z","title":"Division by 0 in `QuantizedAdd`","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 runtime division by zero error and denial of service in `tf.raw_ops.QuantizedBatchNormWithGlobalNormalization`. This is because the implementation(https://github.com/tensorflow/tensorflow/blob/6f26b3f3418201479c264f2a02000880d8df151c/tensorflow/core/kernels/quantized_add_op.cc#L289-L295) computes a modulo operation without validating that the divisor is not zero. Since `vector_num_elements` is determined based on input shapes(https://github.com/tensorflow/tensorflow/blob/6f26b3f3418201479c264f2a02000880d8df151c/tensorflow/core/kernels/quantized_add_op.cc#L522-L544), a user can trigger scenarios where this quantity is 0. 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.00189,"percentile":0.08723,"provenance":"source"},"cwes":[{"id":"CWE-369","name":"Divide By Zero"}],"references":[{"url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-x83m-p7pv-ch8v","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/tensorflow/tensorflow/commit/744009c9e5cc5d0447f0dc39d055f917e1fd9e16","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.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-x83m-p7pv-ch8v","PYSEC-2021-186"],"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-x83m-p7pv-ch8v","PYSEC-2021-477"],"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","<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-x83m-p7pv-ch8v","PYSEC-2021-675"],"provenance":"source"}],"summary":{"text":"The flaw is a missing zero check before a modulo operation in the QuantizedAdd kernel of TensorFlow, the open source machine learning platform, where a divisor derived from input shapes can be zero. An attacker with local access and low privileges, without any user interaction, can craft inputs that trigger a division by zero at runtime, causing a denial of service in the affected operation.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:23:09Z"},"euvd":{"id":"EUVD-2021-0290","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-tensorflow-cve-2021-29549","children":[{"from":"CVE-2021-29549","to":"CVE-2022-35967","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["tensorflow/core/kernels/quantized_add_op.cc"],"commits":["https://github.com/tensorflow/tensorflow/commit/744009c9e5cc5d0447f0dc39d055f917e1fd9e16","https://github.com/tensorflow/tensorflow/commit/49b3824d83af706df0ad07e4e677d88659756d89"],"basis":"shared function","functions":["QuantizedAddOp"]}]},{"from":"CVE-2021-29549","to":"CVE-2022-35979","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["tensorflow/core/kernels/quantized_add_op.cc"],"commits":["https://github.com/tensorflow/tensorflow/commit/744009c9e5cc5d0447f0dc39d055f917e1fd9e16","https://github.com/tensorflow/tensorflow/commit/49b3824d83af706df0ad07e4e677d88659756d89"],"basis":"shared function","functions":["QuantizedAddOp"]}]}]}}