{"id":"CVE-2022-41880","aliases":["CVE-2022-41880","GHSA-8w5g-3wcv-9g2j","BIT-TENSORFLOW-2022-41880","PYSEC-2026-3140","PYSEC-2026-3298","PYSEC-2026-971"],"related":[],"kind":"vulnerability","state":"published","title":"ThreadUnsafeUnigramCandidateSampler Heap out of bounds in Tensorflow","summary":"TensorFlow is an open source platform for machine learning. When the `BaseCandidateSamplerOp` function receives a value in `true_classes` larger than `range_max`, a heap oob read occurs. We have patched the issue in GitHub commit b389f5c944cadfdfe599b3f1e4026e036f30d2d4. The fix will be included in TensorFlow 2.11. We will also cherrypick this commit on TensorFlow 2.10.1, 2.9.3, and TensorFlow 2.8.4, as these are also affected and still in supported range.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"TensorFlow is an open source platform for machine learning. When the `BaseCandidateSamplerOp` function receives a value in `true_classes` larger than `range_max`, a heap oob read occurs. We have patched the issue in GitHub commit b389f5c944cadfdfe599b3f1e4026e036f30d2d4. The fix will be included in TensorFlow 2.11. We will also cherrypick this commit on TensorFlow 2.10.1, 2.9.3, and TensorFlow 2.8.4, as these are also affected and still in supported range.","source":"cvelist"},{"lang":"en","text":"### Impact\nWhen the [`BaseCandidateSamplerOp`](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/kernels/candidate_sampler_ops.cc) function  receives a value in `true_classes` larger than `range_max`, a heap oob vuln occurs.\n```python\ntf.raw_ops.ThreadUnsafeUnigramCandidateSampler(\n    true_classes=[[0x100000,1]],\n    num_true = 2,\n    num_sampled = 2,\n    unique = False,\n    range_max = 2,\n    seed = 2,\n    seed2 = 2)\n```\n\n### Patches\nWe have patched the issue in GitHub commit [b389f5c944cadfdfe599b3f1e4026e036f30d2d4](https://github.com/tensorflow/tensorflow/commit/b389f5c944cadfdfe599b3f1e4026e036f30d2d4).\n\nThe fix will be included in TensorFlow 2.11. We will also cherrypick this commit on TensorFlow 2.10.1, 2.9.3, and TensorFlow 2.8.4, as these are also affected and still in supported range.\n\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\n### Attribution\nThis vulnerability has been reported by Yu Tian of Qihoo 360 AIVul Team.","format":"markdown","source":"ghsa"},{"lang":"es","text":"TensorFlow es una plataforma de código abierto para aprendizaje automático. Cuando la función `BaseCandidateSamplerOp` recibe un valor en `true_classes` mayor que `range_max`, se produce una lectura fuera de los límites del heap. Hemos solucionado el problema en el commit de GitHub b389f5c944cadfdfe599b3f1e4026e036f30d2d4. La solución se incluirá en TensorFlow 2.11. También seleccionaremos este commit en TensorFlow 2.10.1, 2.9.3 y TensorFlow 2.8.4, ya que estos también se ven afectados y aún se encuentran en el rango admitido.","source":"nvd"}],"published":"2022-11-18T00:00:00.000Z","modified":"2026-09-08T08:48:20.605Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:H","score":6.8,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:H","score":6.8,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:H","score":6.8,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H","score":9.1,"rating":"CRITICAL"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:H","score":6.8,"rating":"MEDIUM"},{"scorer":"Bitnami Vulnerability Database","scheme":"rating","rating":"CRITICAL"}],"cwes":["CWE-125"],"affected":[{"ranges":[{"version":">= 2.10.0, < 2.10.1","status":"affected"},{"version":">= 2.9.0, < 2.9.3","status":"affected"},{"version":"< 2.8.4","status":"affected"}],"vendor":"tensorflow","product":"tensorflow","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"2.10.0","status":"affected","fixed":"2.10.1"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.10.0","status":"affected","fixed":"2.10.1"}],"ecosystem":"PyPI","package":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.10.0","status":"affected","fixed":"2.10.1"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.8.4"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.8.4"}],"ecosystem":"PyPI","package":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.8.4"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.9.0","status":"affected","fixed":"2.9.3"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.9.0","status":"affected","fixed":"2.9.3"}],"ecosystem":"PyPI","package":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.9.0","status":"affected","fixed":"2.9.3"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"2.8.4"},{"status":"affected","introduced":"2.9.0","fixed":"2.9.3"},{"status":"affected","version":"2.10.0"}],"vendor":"google","product":"tensorflow","cpe":"cpe:2.3:a:google:tensorflow:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.8.4"},{"type":"ecosystem","introduced":"2.9.0","status":"affected","fixed":"2.9.3"},{"type":"ecosystem","introduced":"2.10.0","status":"affected","fixed":"2.10.1"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","source":"pysec"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.8.4"},{"type":"ecosystem","introduced":"2.9.0","status":"affected","fixed":"2.9.3"},{"type":"ecosystem","introduced":"2.10.0","status":"affected","fixed":"2.10.1"}],"ecosystem":"PyPI","package":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","source":"pysec"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.8.4"},{"type":"ecosystem","introduced":"2.9.0","status":"affected","fixed":"2.9.3"},{"type":"ecosystem","introduced":"2.10.0","status":"affected","fixed":"2.10.1"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","source":"pysec"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.8.4"},{"type":"semver","introduced":"2.9.0","status":"affected","fixed":"2.9.3"},{"type":"semver","introduced":"2.10.0","status":"affected","fixed":"2.10.1"}],"ecosystem":"Bitnami","package":"tensorflow","purl":"pkg:bitnami/tensorflow","source":"bitnami"}],"references":[{"url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-8w5g-3wcv-9g2j","tags":["advisory","exploit","third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec","bitnami"]},{"url":"https://github.com/tensorflow/tensorflow/commit/b389f5c944cadfdfe599b3f1e4026e036f30d2d4","tags":["advisory","patch","third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec","bitnami"]},{"url":"https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/kernels/candidate_sampler_ops.cc","tags":["advisory","third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec","bitnami"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-41880","tags":["advisory","web"],"sources":["ghsa","pysec","bitnami"]},{"url":"https://github.com/tensorflow/tensorflow","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/tensorflow","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-8w5g-3wcv-9g2j","tags":["advisory"],"sources":["pysec"]},{"url":"https://pypi.org/project/tensorflow-cpu","tags":["package"],"sources":["pysec"]},{"url":"https://pypi.org/project/tensorflow-gpu","tags":["package"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2025-04-22T15:42:45.750Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-41880","url":"https://www.cve.org/CVERecord?id=CVE-2022-41880","licence":"CVE Terms of Use","modified":"2025-04-22T16:07:13.537Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-8w5g-3wcv-9g2j","url":"https://github.com/advisories/GHSA-8w5g-3wcv-9g2j","licence":"CC-BY-4.0","modified":"2026-07-13T16:43:00.919Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-41880","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-41880","licence":"Public domain","modified":"2026-06-17T05:03:58.633Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-3140","url":"https://osv.dev/vulnerability/PYSEC-2026-3140","licence":"CC-BY-4.0","modified":"2026-07-13T16:43:00.919Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-3298","url":"https://osv.dev/vulnerability/PYSEC-2026-3298","licence":"CC-BY-4.0","modified":"2026-07-13T16:43:00.919Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-971","url":"https://osv.dev/vulnerability/PYSEC-2026-971","licence":"CC-BY-4.0","modified":"2026-07-13T16:43:00.919Z"},{"source":"bitnami","name":"Bitnami Vulnerability Database","id":"BIT-TENSORFLOW-2022-41880","url":"https://osv.dev/vulnerability/BIT-TENSORFLOW-2022-41880","licence":"Apache-2.0","modified":"2026-09-08T08:48:20.605Z"}],"updatedAt":"2026-11-25T22:58:16.619Z","epss":{"score":0.00554,"percentile":0.47637,"date":"2026-12-02T12:00:21.000Z"}}