{"id":"CVE-2022-21726","aliases":["CVE-2022-21726","GHSA-23hm-7w47-xw72","BIT-TENSORFLOW-2022-21726","PYSEC-2022-105","PYSEC-2022-50","PYSEC-2026-3082"],"related":[],"kind":"vulnerability","state":"published","title":"Out of bounds read in Tensorflow","summary":"Tensorflow is an Open Source Machine Learning Framework. The implementation of `Dequantize` does not fully validate the value of `axis` and can result in heap OOB accesses. The `axis` argument can be `-1` (the default value for the optional argument) or any other positive value at most the number of dimensions of the input. Unfortunately, the upper bound is not checked and this results in reading past the end of the array containing the dimensions of the input tensor. The fix will be included in TensorFlow 2.8.0. We will also cherrypick this commit on TensorFlow 2.7.1, TensorFlow 2.6.3, and TensorFlow 2.5.3, as these are also affected and still in supported range.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Tensorflow is an Open Source Machine Learning Framework. The implementation of `Dequantize` does not fully validate the value of `axis` and can result in heap OOB accesses. The `axis` argument can be `-1` (the default value for the optional argument) or any other positive value at most the number of dimensions of the input. Unfortunately, the upper bound is not checked and this results in reading past the end of the array containing the dimensions of the input tensor. The fix will be included in TensorFlow 2.8.0. We will also cherrypick this commit on TensorFlow 2.7.1, TensorFlow 2.6.3, and TensorFlow 2.5.3, as these are also affected and still in supported range.","source":"cvelist"},{"lang":"en","text":"### Impact \nThe [implementation of `Dequantize`](https://github.com/tensorflow/tensorflow/blob/5100e359aef5c8021f2e71c7b986420b85ce7b3d/tensorflow/core/kernels/dequantize_op.cc#L92-L153) does not fully validate the value of `axis` and can result in heap OOB accesses:\n\n```python\nimport tensorflow as tf\n\n@tf.function\ndef test():\n  y = tf.raw_ops.Dequantize(\n    input=tf.constant([1,1],dtype=tf.qint32),\n    min_range=[1.0],\n    max_range=[10.0],\n    mode='MIN_COMBINED',\n    narrow_range=False,\n    axis=2**31-1,\n    dtype=tf.bfloat16)\n  return y\n\ntest()\n```\n\nThe `axis` argument can be `-1` (the default value for the optional argument) or any other positive value at most the number of dimensions of the input. Unfortunately, the upper bound is not checked and this results in reading past the end of the array containing the dimensions of the input tensor:\n    \n```cc   \n  if (axis_ > -1) {\n    num_slices = input.dim_size(axis_);\n  }\n  // ...\n  int64_t pre_dim = 1, post_dim = 1;\n  for (int i = 0; i < axis_; ++i) {\n    pre_dim *= float_output.dim_size(i);\n  }\n  for (int i = axis_ + 1; i < float_output.dims(); ++i) {\n    post_dim *= float_output.dim_size(i);\n  }\n``` \n      \n### Patches\nWe have patched the issue in GitHub commit [23968a8bf65b009120c43b5ebcceaf52dbc9e943](https://github.com/tensorflow/tensorflow/commit/23968a8bf65b009120c43b5ebcceaf52dbc9e943).\n  \nThe fix will be included in TensorFlow 2.8.0. We will also cherrypick this commit on TensorFlow 2.7.1, TensorFlow 2.6.3, and TensorFlow 2.5.3, 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 Yu Tian of Qihoo 360 AIVul Team.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Tensorflow es un marco de aprendizaje automático de código abierto. La implementación de \"Dequantize\" no comprueba completamente el valor de \"axis\" y puede resultar en accesos OOB a la pila. El argumento \"axis\" puede ser \"-1\" (el valor por defecto para el argumento opcional) o cualquier otro valor positivo como máximo el número de dimensiones de la entrada. Desgraciadamente, el límite superior no es comprobado y esto hace que es leído más allá del final del array que contiene las dimensiones del tensor de entrada. La corrección será incluida en TensorFlow versión 2.8.0. También seleccionaremos este commit en TensorFlow versión 2.7.1, TensorFlow versión 2.6.3, y TensorFlow versión 2.5.3, ya que estos también están afectados y aún están en el rango admitido","source":"nvd"}],"published":"2022-02-03T11:01:42.000Z","modified":"2026-09-10T03:49:11.379Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H","score":8.1,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H","score":8.1,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H","score":8.1,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:N/VA:H/SC:N/SI:N/SA:N","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:S/C:P/I:P/A:P","score":6.5,"rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H","score":8.1,"rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:N/VA:H/SC:N/SI:N/SA:N"},{"scorer":"Bitnami Vulnerability Database","scheme":"rating","rating":"HIGH"}],"cwes":["CWE-125"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.5.3"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.6.0","status":"affected","fixed":"2.6.3"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.7.0","status":"affected","fixed":"2.7.1"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.5.3"}],"ecosystem":"PyPI","package":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.6.0","status":"affected","fixed":"2.6.3"}],"ecosystem":"PyPI","package":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.7.0","status":"affected","fixed":"2.7.1"}],"ecosystem":"PyPI","package":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.5.3"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.6.0","status":"affected","fixed":"2.6.3"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.7.0","status":"affected","fixed":"2.7.1"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","source":"ghsa"},{"ranges":[{"status":"affected","lastAffected":"2.5.2"},{"status":"affected","introduced":"2.6.0","lastAffected":"2.6.2"},{"status":"affected","version":"2.7.0"}],"vendor":"google","product":"tensorflow","cpe":"cpe:2.3:a:google:tensorflow:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"git","introduced":"0","status":"affected","fixed":"23968a8bf65b009120c43b5ebcceaf52dbc9e943"},{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.5.3"},{"type":"ecosystem","introduced":"2.6.0","status":"affected","fixed":"2.6.3"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","repo":"https://github.com/tensorflow/tensorflow","source":"pysec"},{"ranges":[{"type":"git","introduced":"0","status":"affected","fixed":"23968a8bf65b009120c43b5ebcceaf52dbc9e943"},{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.5.3"},{"type":"ecosystem","introduced":"2.6.0","status":"affected","fixed":"2.6.3"}],"ecosystem":"PyPI","package":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","repo":"https://github.com/tensorflow/tensorflow","source":"pysec"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.5.3"},{"type":"ecosystem","introduced":"2.6.0","status":"affected","fixed":"2.6.3"},{"type":"ecosystem","introduced":"2.7.0","status":"affected","fixed":"2.7.1"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","source":"pysec"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.5.3"},{"type":"semver","introduced":"2.6.0","status":"affected","fixed":"2.6.3"},{"type":"semver","introduced":"2.7.0","status":"affected","fixed":"2.7.1"}],"ecosystem":"Bitnami","package":"tensorflow","purl":"pkg:bitnami/tensorflow","source":"bitnami"}],"references":[{"url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-23hm-7w47-xw72","tags":["advisory","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec","bitnami"]},{"url":"https://github.com/tensorflow/tensorflow/commit/23968a8bf65b009120c43b5ebcceaf52dbc9e943","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/5100e359aef5c8021f2e71c7b986420b85ce7b3d/tensorflow/core/kernels/dequantize_op.cc#L92-L153","tags":["advisory","exploit","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec","bitnami"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-21726","tags":["advisory","web"],"sources":["ghsa","pysec","bitnami"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-cpu/PYSEC-2022-50.yaml","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-gpu/PYSEC-2022-105.yaml","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://github.com/tensorflow/tensorflow","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/tensorflow","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-23hm-7w47-xw72","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2025-04-25T15:47:31.390Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-21726","url":"https://www.cve.org/CVERecord?id=CVE-2022-21726","licence":"CVE Terms of Use","modified":"2025-05-05T16:33:01.982Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-23hm-7w47-xw72","url":"https://github.com/advisories/GHSA-23hm-7w47-xw72","licence":"CC-BY-4.0","modified":"2026-09-10T03:49:11.379Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-21726","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-21726","licence":"Public domain","modified":"2026-06-17T04:26:51.967Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2022-105","url":"https://osv.dev/vulnerability/PYSEC-2022-105","licence":"CC-BY-4.0","modified":"2026-07-13T16:43:33.650Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2022-50","url":"https://osv.dev/vulnerability/PYSEC-2022-50","licence":"CC-BY-4.0","modified":"2026-07-13T16:43:33.650Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-3082","url":"https://osv.dev/vulnerability/PYSEC-2026-3082","licence":"CC-BY-4.0","modified":"2026-07-13T16:43:33.650Z"},{"source":"bitnami","name":"Bitnami Vulnerability Database","id":"BIT-TENSORFLOW-2022-21726","url":"https://osv.dev/vulnerability/BIT-TENSORFLOW-2022-21726","licence":"Apache-2.0","modified":"2026-09-08T08:48:25.216Z"}],"updatedAt":"2026-11-25T22:58:09.469Z","epss":{"score":0.00852,"percentile":0.59334,"date":"2026-12-01T12:00:22.000Z"}}