{"id":"CVE-2021-29544","aliases":["CVE-2021-29544","GHSA-6g85-3hm8-83f9","BIT-TENSORFLOW-2021-29544","PYSEC-2021-181","PYSEC-2021-472","PYSEC-2021-670"],"related":[],"kind":"vulnerability","state":"published","title":"CHECK-fail in `QuantizeAndDequantizeV4Grad`","summary":"TensorFlow is an end-to-end open source platform for machine learning. An attacker can trigger a denial of service via a `CHECK`-fail in `tf.raw_ops.QuantizeAndDequantizeV4Grad`. This is because the implementation does not validate the rank of the `input_*` tensors. In turn, this results in the tensors being passes as they are to `QuantizeAndDequantizePerChannelGradientImpl`. However, the `vec<T>` method, requires the rank to 1 and triggers a `CHECK` failure otherwise. The fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2 as this is the only other affected version.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"TensorFlow is an end-to-end open source platform for machine learning. An attacker can trigger a denial of service via a `CHECK`-fail in `tf.raw_ops.QuantizeAndDequantizeV4Grad`. This is because the implementation does not validate the rank of the `input_*` tensors. In turn, this results in the tensors being passes as they are to `QuantizeAndDequantizePerChannelGradientImpl`. However, the `vec<T>` method, requires the rank to 1 and triggers a `CHECK` failure otherwise. The fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2 as this is the only other affected version.","source":"cvelist"},{"lang":"en","text":"### Impact\nAn attacker can trigger a denial of service via a `CHECK`-fail in `tf.raw_ops.QuantizeAndDequantizeV4Grad`:\n\n```python\nimport tensorflow as tf\n\ngradient_tensor = tf.constant([0.0], shape=[1])\ninput_tensor = tf.constant([0.0], shape=[1])\ninput_min = tf.constant([[0.0]], shape=[1, 1])\ninput_max = tf.constant([[0.0]], shape=[1, 1])\n\ntf.raw_ops.QuantizeAndDequantizeV4Grad(\n  gradients=gradient_tensor, input=input_tensor,\n  input_min=input_min, input_max=input_max, axis=0)\n```                     \n                        \nThis is because the [implementation](https://github.com/tensorflow/tensorflow/blob/95078c145b5a7a43ee046144005f733092756ab5/tensorflow/core/kernels/quantize_and_dequantize_op.cc#L162-L163) does not validate the rank of the `input_*` tensors. In turn, this results in the tensors being passes as they are to [`QuantizeAndDequantizePerChannelGradientImpl`](https://github.com/tensorflow/tensorflow/blob/95078c145b5a7a43ee046144005f733092756ab5/tensorflow/core/kernels/quantize_and_dequantize_op.h#L295-L306):\n\n```cc \ntemplate <typename Device, typename T>\nstruct QuantizeAndDequantizePerChannelGradientImpl {\n  static void Compute(const Device& d,\n                      typename TTypes<T, 3>::ConstTensor gradient,\n                      typename TTypes<T, 3>::ConstTensor input,\n                      const Tensor* input_min_tensor,\n                      const Tensor* input_max_tensor,\n                      typename TTypes<T, 3>::Tensor input_backprop,\n                      typename TTypes<T>::Flat input_min_backprop,\n                      typename TTypes<T>::Flat input_max_backprop) {\n    ...\n    auto input_min = input_min_tensor->vec<T>();\n    auto input_max = input_max_tensor->vec<T>();\n    ...\n}\n```\n\nHowever, the `vec<T>` method, requires the rank to 1 and triggers a `CHECK` failure otherwise.\n\n### Patches\nWe have patched the issue in GitHub commit [20431e9044cf2ad3c0323c34888b192f3289af6b](https://github.com/tensorflow/tensorflow/commit/20431e9044cf2ad3c0323c34888b192f3289af6b).\n\nThe fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2 as this is the only other affected version.\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 desencadenar una denegación de servicio por medio de \"CHECK\" en \"tf.raw_ops.QuantizeAndDequantizeV4Grad\".&#xa0;Esto es debido a que la implementación (https://github.com/tensorflow/tensorflow/blob/95078c145b5a7a43ee046144005f733092756ab5/tensorflow/core/kernels/quantize_and_dequantize_op.cc#L162-L163) no comprueba el rango de los tensores \"input_ *\".&#xa0;A su vez, esto resulta en que los tensores pasen tal como están a \"QuantizeAndDequantizePerChannelGradientImpl\" (https://github.com/tensorflow/tensorflow/blob/95078c145b5a7a43ee046144005f733092756ab5/tensorflow/core/kernels/quantize_and_op. Sin embargo, el método \"vec(T)\" requiere el rango de 1 y, de lo contrario, desencadena un fallo \"CHECK\".&#xa0;La corrección será incluida en TensorFlow versión 2.5.0.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 compatible","source":"nvd"},{"lang":"en","text":"TensorFlow is an end-to-end open source platform for machine learning. An attacker can trigger a denial of service via a `CHECK`-fail in `tf.raw_ops.QuantizeAndDequantizeV4Grad`. This is because the implementation(https://github.com/tensorflow/tensorflow/blob/95078c145b5a7a43ee046144005f733092756ab5/tensorflow/core/kernels/quantize_and_dequantize_op.cc#L162-L163) does not validate the rank of the `input_*` tensors. In turn, this results in the tensors being passes as they are to `QuantizeAndDequantizePerChannelGradientImpl`(https://github.com/tensorflow/tensorflow/blob/95078c145b5a7a43ee046144005f733092756ab5/tensorflow/core/kernels/quantize_and_dequantize_op.h#L295-L306). However, the `vec<T>` method, requires the rank to 1 and triggers a `CHECK` failure otherwise. The fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2 as this is the only other affected version.","format":"markdown","source":"pysec"}],"published":"2021-05-14T19:11:06.000Z","modified":"2026-09-08T08:48:10.867Z","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-754"],"affected":[{"ranges":[{"version":">= 2.4.0, < 2.4.2","status":"affected"}],"vendor":"tensorflow","product":"tensorflow","source":"cvelist"},{"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":"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":"2.4.0","status":"affected","fixed":"2.4.2"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","source":"ghsa"},{"ranges":[{"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":"20431e9044cf2ad3c0323c34888b192f3289af6b"},{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.2.0rc0"},{"type":"ecosystem","introduced":"2.2.0","status":"affected","fixed":"2.3.0rc0"},{"type":"ecosystem","introduced":"2.3.0","status":"affected","fixed":"2.3.4"},{"type":"ecosystem","introduced":"2.4.0","status":"affected","fixed":"2.4.3"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","repo":"https://github.com/tensorflow/tensorflow","source":"pysec"},{"ranges":[{"type":"git","introduced":"0","status":"affected","fixed":"20431e9044cf2ad3c0323c34888b192f3289af6b"},{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.2.0rc0"},{"type":"ecosystem","introduced":"2.2.0","status":"affected","fixed":"2.3.0rc0"},{"type":"ecosystem","introduced":"2.3.0","status":"affected","fixed":"2.3.4"},{"type":"ecosystem","introduced":"2.4.0","status":"affected","fixed":"2.4.3"}],"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":"20431e9044cf2ad3c0323c34888b192f3289af6b"},{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.2.0rc0"},{"type":"ecosystem","introduced":"2.2.0","status":"affected","fixed":"2.3.0rc0"},{"type":"ecosystem","introduced":"2.3.0","status":"affected","fixed":"2.3.4"},{"type":"ecosystem","introduced":"2.4.0","status":"affected","fixed":"2.4.3"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","repo":"https://github.com/tensorflow/tensorflow","source":"pysec"},{"ranges":[{"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-6g85-3hm8-83f9","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/20431e9044cf2ad3c0323c34888b192f3289af6b","tags":["advisory","fix","patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec","bitnami"]},{"url":"https://github.com/tensorflow/tensorflow/blob/95078c145b5a7a43ee046144005f733092756ab5/tensorflow/core/kernels/quantize_and_dequantize_op.cc#L162-L163","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","bitnami"]},{"url":"https://github.com/tensorflow/tensorflow/blob/95078c145b5a7a43ee046144005f733092756ab5/tensorflow/core/kernels/quantize_and_dequantize_op.h#L295-L306","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","bitnami"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-29544","tags":["advisory","web"],"sources":["ghsa","bitnami"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-cpu/PYSEC-2021-472.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-gpu/PYSEC-2021-670.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow/PYSEC-2021-181.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-29544","url":"https://www.cve.org/CVERecord?id=CVE-2021-29544","licence":"CVE Terms of Use","modified":"2024-10-31T20:41:21.258Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-6g85-3hm8-83f9","url":"https://github.com/advisories/GHSA-6g85-3hm8-83f9","licence":"CC-BY-4.0","modified":"2026-07-08T06:28:48.815Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-29544","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-29544","licence":"Public domain","modified":"2026-06-17T03:47:52.727Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2021-181","url":"https://osv.dev/vulnerability/PYSEC-2021-181","licence":"CC-BY-4.0","modified":"2023-12-06T01:01:05.139Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2021-472","url":"https://osv.dev/vulnerability/PYSEC-2021-472","licence":"CC-BY-4.0","modified":"2023-12-06T01:01:05.139Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2021-670","url":"https://osv.dev/vulnerability/PYSEC-2021-670","licence":"CC-BY-4.0","modified":"2023-12-06T01:01:05.139Z"},{"source":"bitnami","name":"Bitnami Vulnerability Database","id":"BIT-TENSORFLOW-2021-29544","url":"https://osv.dev/vulnerability/BIT-TENSORFLOW-2021-29544","licence":"Apache-2.0","modified":"2026-09-08T08:48:10.867Z"}],"updatedAt":"2026-11-25T22:58:01.375Z","epss":{"score":0.0031,"percentile":0.25689,"date":"2026-12-01T12:00:22.000Z"}}