{"id":"CVE-2022-41887","aliases":["CVE-2022-41887","GHSA-8fvv-46hw-vpg3","BIT-TENSORFLOW-2022-41887","PYSEC-2026-3136","PYSEC-2026-3297","PYSEC-2026-970"],"related":[],"kind":"vulnerability","state":"published","title":"Overflow in `tf.keras.losses.poisson` in Tensorflow","summary":"TensorFlow is an open source platform for machine learning. `tf.keras.losses.poisson` receives a `y_pred` and `y_true` that are passed through `functor::mul` in `BinaryOp`. If the resulting dimensions overflow an `int32`, TensorFlow will crash due to a size mismatch during broadcast assignment. We have patched the issue in GitHub commit c5b30379ba87cbe774b08ac50c1f6d36df4ebb7c. The fix will be included in TensorFlow 2.11. We will also cherrypick this commit on TensorFlow 2.10.1 and 2.9.3, as these are also affected and still in supported range. However, we will not cherrypick this commit into TensorFlow 2.8.x, as it depends on Eigen behavior that changed between 2.8 and 2.9.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"TensorFlow is an open source platform for machine learning. `tf.keras.losses.poisson` receives a `y_pred` and `y_true` that are passed through `functor::mul` in `BinaryOp`. If the resulting dimensions overflow an `int32`, TensorFlow will crash due to a size mismatch during broadcast assignment. We have patched the issue in GitHub commit c5b30379ba87cbe774b08ac50c1f6d36df4ebb7c. The fix will be included in TensorFlow 2.11. We will also cherrypick this commit on TensorFlow 2.10.1 and 2.9.3, as these are also affected and still in supported range. However, we will not cherrypick this commit into TensorFlow 2.8.x, as it depends on Eigen behavior that changed between 2.8 and 2.9.","source":"cvelist"},{"lang":"en","text":"### Impact\n[`tf.keras.losses.poisson`](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/keras/losses.py) receives a `y_pred` and `y_true` that are passed through `functor::mul` in [`BinaryOp`](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/kernels/cwise_ops_common.h). If the resulting dimensions overflow an `int32`, TensorFlow will crash due to a size mismatch during broadcast assignment.\n```python\nimport numpy as np\nimport tensorflow as tf\n\ntrue_value = tf.reshape(shape=[1, 2500000000], tensor = tf.zeros(dtype=tf.bool, shape=[50000, 50000]))\npred_value = np.array([[[-2]], [[8]]], dtype = np.float64)\n\ntf.keras.losses.poisson(y_true=true_value,y_pred=pred_value)\n```\n\n### Patches\nWe have patched the issue in GitHub commit [c5b30379ba87cbe774b08ac50c1f6d36df4ebb7c](https://github.com/tensorflow/tensorflow/commit/c5b30379ba87cbe774b08ac50c1f6d36df4ebb7c).\n\nThe fix will be included in TensorFlow 2.11. We will also cherrypick this commit on TensorFlow 2.10.1 and 2.9.3, as these are also affected and still in supported range. However, we will not cherrypick this commit into TensorFlow 2.8.x, as it depends on Eigen behavior that changed between 2.8 and 2.9.\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 Pattarakrit Rattankul.","format":"markdown","source":"ghsa"},{"lang":"es","text":"TensorFlow es una plataforma de código abierto para aprendizaje automático. `tf.keras.losses.poisson` recibe `y_pred` y `y_true` que se pasan a través de `functor::mul` en `BinaryOp`. Si las dimensiones resultantes desbordan un `int32`, TensorFlow fallará debido a una discrepancia de tamaño durante la asignación de transmisión. Hemos solucionado el problema en el commit de GitHub c5b30379ba87cbe774b08ac50c1f6d36df4ebb7c. La solución se incluirá en TensorFlow 2.11. También seleccionaremos este commit en TensorFlow 2.10.1 y 2.9.3, ya que también se ven afectados y aún se encuentran en el rango admitido. Sin embargo, no seleccionaremos este commit en TensorFlow 2.8.x, ya que depende del comportamiento propio que cambió entre 2.8 y 2.9.","source":"nvd"}],"published":"2022-11-18T00:00:00.000Z","modified":"2026-09-08T08:48:20.624Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:N/I:N/A:H","score":4.8,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:N/I:N/A:H","score":4.8,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:N/I:N/A:H","score":4.8,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:N/I:N/A:H","score":4.8,"rating":"MEDIUM"},{"scorer":"Bitnami Vulnerability Database","scheme":"rating","rating":"HIGH"}],"cwes":["CWE-131"],"affected":[{"ranges":[{"version":">= 2.10.0, < 2.10.1","status":"affected"},{"version":"< 2.9.3","status":"affected"}],"vendor":"tensorflow","product":"tensorflow","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.9.3"}],"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","purl":"pkg:pypi/tensorflow","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.9.3"}],"ecosystem":"PyPI","package":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.9.3"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","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":[{"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.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.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.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":"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-8fvv-46hw-vpg3","tags":["advisory","exploit","patch","third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec","bitnami"]},{"url":"https://github.com/tensorflow/tensorflow/commit/c5b30379ba87cbe774b08ac50c1f6d36df4ebb7c","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/cwise_ops_common.h","tags":["advisory","third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec","bitnami"]},{"url":"https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/keras/losses.py","tags":["advisory","third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec","bitnami"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-41887","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-8fvv-46hw-vpg3","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:29.614Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-41887","url":"https://www.cve.org/CVERecord?id=CVE-2022-41887","licence":"CVE Terms of Use","modified":"2025-04-22T16:06:20.833Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-8fvv-46hw-vpg3","url":"https://github.com/advisories/GHSA-8fvv-46hw-vpg3","licence":"CC-BY-4.0","modified":"2026-07-13T16:43:24.088Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-41887","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-41887","licence":"Public domain","modified":"2026-06-17T05:03:59.920Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-3136","url":"https://osv.dev/vulnerability/PYSEC-2026-3136","licence":"CC-BY-4.0","modified":"2026-07-13T16:43:24.088Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-3297","url":"https://osv.dev/vulnerability/PYSEC-2026-3297","licence":"CC-BY-4.0","modified":"2026-07-13T16:43:24.088Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-970","url":"https://osv.dev/vulnerability/PYSEC-2026-970","licence":"CC-BY-4.0","modified":"2026-07-13T16:43:24.088Z"},{"source":"bitnami","name":"Bitnami Vulnerability Database","id":"BIT-TENSORFLOW-2022-41887","url":"https://osv.dev/vulnerability/BIT-TENSORFLOW-2022-41887","licence":"Apache-2.0","modified":"2026-09-08T08:48:20.624Z"}],"updatedAt":"2026-11-25T22:58:16.625Z","epss":{"score":0.0064,"percentile":0.52023,"date":"2026-12-02T12:00:21.000Z"}}