{"id":"CVE-2022-23558","aliases":["CVE-2022-23558","GHSA-9gwq-6cwj-47h3","BIT-TENSORFLOW-2022-23558","PYSEC-2022-122","PYSEC-2022-67","PYSEC-2026-3151"],"related":[],"kind":"vulnerability","state":"published","title":"Integer overflow in TFLite array creation","summary":"Tensorflow is an Open Source Machine Learning Framework. An attacker can craft a TFLite model that would cause an integer overflow in `TfLiteIntArrayCreate`. The `TfLiteIntArrayGetSizeInBytes` returns an `int` instead of a `size_t. An attacker can control model inputs such that `computed_size` overflows the size of `int` datatype. 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. An attacker can craft a TFLite model that would cause an integer overflow in `TfLiteIntArrayCreate`. The `TfLiteIntArrayGetSizeInBytes` returns an `int` instead of a `size_t. An attacker can control model inputs such that `computed_size` overflows the size of `int` datatype. 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 \nAn attacker can craft a TFLite model that would cause an integer overflow [in `TfLiteIntArrayCreate`](https://github.com/tensorflow/tensorflow/blob/ca6f96b62ad84207fbec580404eaa7dd7403a550/tensorflow/lite/c/common.c#L53-L60):\n\n```cc\nTfLiteIntArray* TfLiteIntArrayCreate(int size) {\n  int alloc_size = TfLiteIntArrayGetSizeInBytes(size);\n  // ...\n  TfLiteIntArray* ret = (TfLiteIntArray*)malloc(alloc_size);\n  // ...\n} \n```\n\nThe [`TfLiteIntArrayGetSizeInBytes`](https://github.com/tensorflow/tensorflow/blob/ca6f96b62ad84207fbec580404eaa7dd7403a550/tensorflow/lite/c/common.c#L24-L33) returns an `int` instead of a `size_t`:\n\n```cc\nint TfLiteIntArrayGetSizeInBytes(int size) {\n  static TfLiteIntArray dummy;\n\n  int computed_size = sizeof(dummy) + sizeof(dummy.data[0]) * size;\n#if defined(_MSC_VER)\n  // Context for why this is needed is in http://b/189926408#comment21\n  computed_size -= sizeof(dummy.data[0]);\n#endif\n  return computed_size;\n}\n```\n\nAn attacker can control model inputs such that `computed_size` overflows the size of `int` datatype.\n\n### Patches\nWe have patched the issue in GitHub commit [a1e1511dde36b3f8aa27a6ec630838e7ea40e091](https://github.com/tensorflow/tensorflow/commit/a1e1511dde36b3f8aa27a6ec630838e7ea40e091).\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 Wang Xuan of Qihoo 360 AIVul Team.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Tensorflow es un Marco de Aprendizaje Automático de Código Abierto. Un atacante puede diseñar un modelo TFLite que cause un desbordamiento de enteros en \"TfLiteIntArrayCreate\". El \"TfLiteIntArrayGetSizeInBytes\" devuelve un \"int\" en lugar de un \"size_t\". Un atacante puede controlar las entradas del modelo de forma que \"computed_size\" desborde el tamaño del tipo de datos \"int\". 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-04T22:32:43.000Z","modified":"2026-09-08T08:48:25.196Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:H","score":7.6,"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:L/I:L/A:H","score":7.6,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:H","score":7.6,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:L/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:L/I:L/A:H","score":7.6,"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:L/VI:L/VA:H/SC:N/SI:N/SA:N"},{"scorer":"Bitnami Vulnerability Database","scheme":"rating","rating":"HIGH"}],"cwes":["CWE-190"],"affected":[{"ranges":[{"version":">= 2.7.0, < 2.7.1","status":"affected"},{"version":">= 2.6.0, < 2.6.3","status":"affected"},{"version":"< 2.5.3","status":"affected"}],"vendor":"tensorflow","product":"tensorflow","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":"a1e1511dde36b3f8aa27a6ec630838e7ea40e091"},{"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":"a1e1511dde36b3f8aa27a6ec630838e7ea40e091"},{"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-9gwq-6cwj-47h3","tags":["advisory","patch","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec","bitnami"]},{"url":"https://github.com/tensorflow/tensorflow/commit/a1e1511dde36b3f8aa27a6ec630838e7ea40e091","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/ca6f96b62ad84207fbec580404eaa7dd7403a550/tensorflow/lite/c/common.c#L24-L33","tags":["advisory","exploit","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec","bitnami"]},{"url":"https://github.com/tensorflow/tensorflow/blob/ca6f96b62ad84207fbec580404eaa7dd7403a550/tensorflow/lite/c/common.c#L53-L60","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-23558","tags":["advisory","web"],"sources":["ghsa","pysec","bitnami"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-cpu/PYSEC-2022-67.yaml","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-gpu/PYSEC-2022-122.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-9gwq-6cwj-47h3","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2025-04-22T15:49:53.186Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-23558","url":"https://www.cve.org/CVERecord?id=CVE-2022-23558","licence":"CVE Terms of Use","modified":"2025-04-22T18:23:00.833Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-9gwq-6cwj-47h3","url":"https://github.com/advisories/GHSA-9gwq-6cwj-47h3","licence":"CC-BY-4.0","modified":"2026-07-13T16:42:29.063Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-23558","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-23558","licence":"Public domain","modified":"2026-06-17T04:30:21.227Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2022-122","url":"https://osv.dev/vulnerability/PYSEC-2022-122","licence":"CC-BY-4.0","modified":"2026-07-13T16:42:29.063Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2022-67","url":"https://osv.dev/vulnerability/PYSEC-2022-67","licence":"CC-BY-4.0","modified":"2026-07-13T16:42:29.063Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-3151","url":"https://osv.dev/vulnerability/PYSEC-2026-3151","licence":"CC-BY-4.0","modified":"2026-07-13T16:42:29.063Z"},{"source":"bitnami","name":"Bitnami Vulnerability Database","id":"BIT-TENSORFLOW-2022-23558","url":"https://osv.dev/vulnerability/BIT-TENSORFLOW-2022-23558","licence":"Apache-2.0","modified":"2026-09-08T08:48:25.196Z"}],"updatedAt":"2026-11-25T22:58:09.505Z","epss":{"score":0.00845,"percentile":0.59177,"date":"2026-12-02T12:00:21.000Z"}}