{"id":"CVE-2022-29197","aliases":["CVE-2022-29197","GHSA-hrg5-737c-2p56","BIT-TENSORFLOW-2022-29197","PYSEC-2026-1009","PYSEC-2026-3202","PYSEC-2026-3341"],"related":[],"kind":"vulnerability","state":"published","title":"Missing validation causes denial of service in TensorFlow via `UnsortedSegmentJoin`","summary":"TensorFlow is an open source platform for machine learning. Prior to versions 2.9.0, 2.8.1, 2.7.2, and 2.6.4, the implementation of `tf.raw_ops.UnsortedSegmentJoin` does not fully validate the input arguments. This results in a `CHECK`-failure which can be used to trigger a denial of service attack. The code assumes `num_segments` is a scalar but there is no validation for this before accessing its value. Versions 2.9.0, 2.8.1, 2.7.2, and 2.6.4 contain a patch for this issue.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"TensorFlow is an open source platform for machine learning. Prior to versions 2.9.0, 2.8.1, 2.7.2, and 2.6.4, the implementation of `tf.raw_ops.UnsortedSegmentJoin` does not fully validate the input arguments. This results in a `CHECK`-failure which can be used to trigger a denial of service attack. The code assumes `num_segments` is a scalar but there is no validation for this before accessing its value. Versions 2.9.0, 2.8.1, 2.7.2, and 2.6.4 contain a patch for this issue.","source":"cvelist"},{"lang":"en","text":"### Impact\nThe implementation of [`tf.raw_ops.UnsortedSegmentJoin`](https://github.com/tensorflow/tensorflow/blob/f3b9bf4c3c0597563b289c0512e98d4ce81f886e/tensorflow/core/kernels/unsorted_segment_join_op.cc#L92-L95) does not fully validate the input arguments. This results in a `CHECK`-failure which can be used to trigger a denial of service attack:\n\n```python\nimport tensorflow as tf\n\ntf.raw_ops.UnsortedSegmentJoin(\n  inputs=tf.constant(\"this\", shape=[12], dtype=tf.string),\n  segment_ids=tf.constant(0, shape=[12], dtype=tf.int64),\n  num_segments=tf.constant(0, shape=[12], dtype=tf.int64))\n``` \n  \nThe code assumes `num_segments` is a scalar but there is no validation for this before accessing its value:\n\n```cc\nconst Tensor& num_segments_tensor = context->input(2);\nOP_REQUIRES(context, num_segments_tensor.NumElements() != 0,\n            errors::InvalidArgument(\"Number of segments cannot be empty.\"));\nauto num_segments = num_segments_tensor.scalar<NUM_SEGMENTS_TYPE>()();\n``` \n\n### Patches\nWe have patched the issue in GitHub commit [13d38a07ce9143e044aa737cfd7bb759d0e9b400](https://github.com/tensorflow/tensorflow/commit/13d38a07ce9143e044aa737cfd7bb759d0e9b400).\n\nThe fix will be included in TensorFlow 2.9.0. We will also cherrypick this commit on TensorFlow 2.8.1, TensorFlow 2.7.2, and TensorFlow 2.6.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 Neophytos Christou from Secure Systems Lab at Brown University.","format":"markdown","source":"ghsa"},{"lang":"es","text":"TensorFlow es una plataforma de código abierto para el aprendizaje automático. En versiones anteriores a 2.9.0, 2.8.1, 2.7.2 y 2.6.4, la implementación de \"tf.raw_ops.UnsortedSegmentJoin\" no comprobaba completamente los argumentos de entrada. Esto resulta en un fallo de \"CHECK\" que puede ser usado para desencadenar un ataque de denegación de servicio. El código asume que \"num_segments\" es un escalar pero no es comprobado antes de acceder a su valor. Las versiones 2.9.0, 2.8.1, 2.7.2 y 2.6.4 contienen un parche para este problema","source":"nvd"}],"published":"2022-05-20T21:55:18.000Z","modified":"2026-09-08T08:48:25.310Z","severity":{"scorer":"GitHub_M","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"},"severities":[{"scorer":"GitHub_M","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":"GitHub","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: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":"PyPA Advisory Database","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":"Bitnami Vulnerability Database","scheme":"rating","rating":"MEDIUM"}],"cwes":["CWE-20"],"affected":[{"ranges":[{"version":"< 2.6.4","status":"affected"},{"version":">= 2.7.0rc0, < 2.7.2","status":"affected"},{"version":">= 2.8.0rc0, < 2.8.1","status":"affected"},{"version":">= 2.9.0rc0, < 2.9.0","status":"affected"}],"vendor":"tensorflow","product":"tensorflow","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.6.4"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.7.0","status":"affected","fixed":"2.7.2"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.8.0","status":"affected","fixed":"2.8.1"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.6.4"}],"ecosystem":"PyPI","package":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.7.0","status":"affected","fixed":"2.7.2"}],"ecosystem":"PyPI","package":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.8.0","status":"affected","fixed":"2.8.1"}],"ecosystem":"PyPI","package":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.6.4"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.7.0","status":"affected","fixed":"2.7.2"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.8.0","status":"affected","fixed":"2.8.1"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"2.6.4"},{"status":"affected","introduced":"2.7.0","fixed":"2.7.2"},{"status":"affected","version":"2.7.0"},{"status":"affected","version":"2.7.0"},{"status":"affected","version":"2.7.0"},{"status":"affected","version":"2.8.0"},{"status":"affected","version":"2.8.0"},{"status":"affected","version":"2.9.0"},{"status":"affected","version":"2.9.0"}],"vendor":"google","product":"tensorflow","cpe":"cpe:2.3:a:google:tensorflow:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.6.4"},{"type":"ecosystem","introduced":"2.7.0","status":"affected","fixed":"2.7.2"},{"type":"ecosystem","introduced":"2.8.0","status":"affected","fixed":"2.8.1"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","source":"pysec"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.6.4"},{"type":"ecosystem","introduced":"2.7.0","status":"affected","fixed":"2.7.2"},{"type":"ecosystem","introduced":"2.8.0","status":"affected","fixed":"2.8.1"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","source":"pysec"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.6.4"},{"type":"ecosystem","introduced":"2.7.0","status":"affected","fixed":"2.7.2"},{"type":"ecosystem","introduced":"2.8.0","status":"affected","fixed":"2.8.1"}],"ecosystem":"PyPI","package":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","source":"pysec"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.6.4"},{"type":"semver","introduced":"2.7.0","status":"affected","fixed":"2.7.2"}],"ecosystem":"Bitnami","package":"tensorflow","purl":"pkg:bitnami/tensorflow","source":"bitnami"}],"references":[{"url":"https://github.com/tensorflow/tensorflow/releases/tag/v2.6.4","tags":["advisory","release-notes","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec","bitnami"]},{"url":"https://github.com/tensorflow/tensorflow/releases/tag/v2.7.2","tags":["advisory","release-notes","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec","bitnami"]},{"url":"https://github.com/tensorflow/tensorflow/releases/tag/v2.8.1","tags":["advisory","release-notes","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec","bitnami"]},{"url":"https://github.com/tensorflow/tensorflow/releases/tag/v2.9.0","tags":["advisory","release-notes","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec","bitnami"]},{"url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-hrg5-737c-2p56","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/13d38a07ce9143e044aa737cfd7bb759d0e9b400","tags":["advisory","patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec","bitnami"]},{"url":"https://github.com/tensorflow/tensorflow/blob/f3b9bf4c3c0597563b289c0512e98d4ce81f886e/tensorflow/core/kernels/unsorted_segment_join_op.cc#L92-L95","tags":["advisory","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec","bitnami"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-29197","tags":["advisory","web"],"sources":["ghsa","pysec","bitnami"]},{"url":"https://github.com/tensorflow/tensorflow","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/tensorflow-gpu","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-hrg5-737c-2p56","tags":["advisory"],"sources":["pysec"]},{"url":"https://pypi.org/project/tensorflow","tags":["package"],"sources":["pysec"]},{"url":"https://pypi.org/project/tensorflow-cpu","tags":["package"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2025-04-22T15:47:19.435Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-29197","url":"https://www.cve.org/CVERecord?id=CVE-2022-29197","licence":"CVE Terms of Use","modified":"2025-04-22T17:59:07.613Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-hrg5-737c-2p56","url":"https://github.com/advisories/GHSA-hrg5-737c-2p56","licence":"CC-BY-4.0","modified":"2026-07-13T16:42:30.497Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-29197","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-29197","licence":"Public domain","modified":"2026-06-17T04:39:47.830Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-1009","url":"https://osv.dev/vulnerability/PYSEC-2026-1009","licence":"CC-BY-4.0","modified":"2026-07-13T16:42:30.497Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-3202","url":"https://osv.dev/vulnerability/PYSEC-2026-3202","licence":"CC-BY-4.0","modified":"2026-07-13T16:42:30.497Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-3341","url":"https://osv.dev/vulnerability/PYSEC-2026-3341","licence":"CC-BY-4.0","modified":"2026-07-13T16:42:30.497Z"},{"source":"bitnami","name":"Bitnami Vulnerability Database","id":"BIT-TENSORFLOW-2022-29197","url":"https://osv.dev/vulnerability/BIT-TENSORFLOW-2022-29197","licence":"Apache-2.0","modified":"2026-09-08T08:48:25.310Z"}],"updatedAt":"2026-11-25T22:58:11.867Z","epss":{"score":0.00325,"percentile":0.276,"date":"2026-12-01T12:00:22.000Z"}}