{"id":"CVE-2020-15214","aliases":["CVE-2020-15214","GHSA-p2cq-cprg-frvm","BIT-TENSORFLOW-2020-15214","PYSEC-2020-137","PYSEC-2020-294","PYSEC-2020-329"],"related":[],"kind":"vulnerability","state":"published","title":"Out of bounds write in tensorflow-lite","summary":"In TensorFlow Lite before versions 2.2.1 and 2.3.1, models using segment sum can trigger a write out bounds / segmentation fault if the segment ids are not sorted. Code assumes that the segment ids are in increasing order, using the last element of the tensor holding them to determine the dimensionality of output tensor. This results in allocating insufficient memory for the output tensor and in a write outside the bounds of the output array. This usually results in a segmentation fault, but depending on runtime conditions it can provide for a write gadget to be used in future memory corruption-based exploits. The issue is patched in commit 204945b19e44b57906c9344c0d00120eeeae178a and is released in TensorFlow versions 2.2.1, or 2.3.1. A potential workaround would be to add a custom `Verifier` to the model loading code to ensure that the segment ids are sorted, although this only handles the case when the segment ids are stored statically in the model. A similar validation could be done if the segment ids are generated at runtime between inference steps. If the segment ids are generated as outputs of a tensor during inference steps, then there are no possible workaround and users are advised to upgrade to patched code.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In TensorFlow Lite before versions 2.2.1 and 2.3.1, models using segment sum can trigger a write out bounds / segmentation fault if the segment ids are not sorted. Code assumes that the segment ids are in increasing order, using the last element of the tensor holding them to determine the dimensionality of output tensor. This results in allocating insufficient memory for the output tensor and in a write outside the bounds of the output array. This usually results in a segmentation fault, but depending on runtime conditions it can provide for a write gadget to be used in future memory corruption-based exploits. The issue is patched in commit 204945b19e44b57906c9344c0d00120eeeae178a and is released in TensorFlow versions 2.2.1, or 2.3.1. A potential workaround would be to add a custom `Verifier` to the model loading code to ensure that the segment ids are sorted, although this only handles the case when the segment ids are stored statically in the model. A similar validation could be done if the segment ids are generated at runtime between inference steps. If the segment ids are generated as outputs of a tensor during inference steps, then there are no possible workaround and users are advised to upgrade to patched code.","source":"cvelist"},{"lang":"en","text":"### Impact\nIn TensorFlow Lite models using segment sum can trigger a write out bounds / segmentation fault if the segment ids are not sorted. Code assumes that the segment ids are in increasing order, using the last element of the tensor holding them to determine the dimensionality of output tensor:\nhttps://github.com/tensorflow/tensorflow/blob/0e68f4d3295eb0281a517c3662f6698992b7b2cf/tensorflow/lite/kernels/segment_sum.cc#L39-L44\n\nThis results in allocating insufficient memory for the output tensor and in a write outside the bounds of the output array:\nhttps://github.com/tensorflow/tensorflow/blob/0e68f4d3295eb0281a517c3662f6698992b7b2cf/tensorflow/lite/kernels/internal/reference/reference_ops.h#L2625-L2631\n\nThis usually results in a segmentation fault, but depending on runtime conditions it can provide for a write gadget to be used in future memory corruption-based exploits.\n\n### Patches\nWe have patched the issue in 204945b and will release patch releases for all affected versions.\n\nWe recommend users to upgrade to TensorFlow 2.2.1, or 2.3.1.\n\n### Workarounds\nA potential workaround would be to add a custom `Verifier` to the model loading code to ensure that the segment ids are sorted, although this only handles the case when the segment ids are stored statically in the model.\n\nA similar validation could be done if the segment ids are generated at runtime between inference steps.\n\nIf the segment ids are generated as outputs of a tensor during inference steps, then there are no possible workaround and users are advised to upgrade to patched code.\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 members of the Aivul Team from Qihoo 360.","format":"markdown","source":"ghsa"},{"lang":"es","text":"En TensorFlow Lite versiones anteriores a 2.2.1 y 2.3.1, los modelos que utilizan la suma de segmentos pueden desencadenar un fallo de segmentación y una escritura fuera de límites si los ids de segmento no están ordenados. El código asume que los ids de segmento están en orden creciente, usando el último elemento del tensor que los conserva para determinar la dimensionalidad del tensor de salida. Esto resulta en una asignación de memoria insuficiente para el tensor de salida y una escritura fuera de límites de la matriz de salida. Esto usualmente, resulta en un fallo de segmentación, pero dependiendo de las condiciones del tiempo de ejecución, puede proporcionar un gadget de escritura que se usará en futuras explotaciones basadas ??en una corrupción de la memoria. El problema es parcheado en el commit 204945b19e44b57906c9344c0d00120eeeae178a y es publicado en TensorFlow versiones 2.2.1 o 2.3.1. Una solución alternativa potencial sería agregar un \"Verifier\" personalizado al código de carga del modelo para asegurar que los ids de segmento estén ordenados, aunque esto solo maneja el caso cuando los ids de segmento son almacenados estáticamente en el modelo. Una comprobación similar podría ser realizada si los ids de segmento se generan en el tiempo de ejecución entre los pasos de inferencia. Si los ids de segmento son generados como salidas de un tensor durante los pasos de inferencia, entonces no existe una posible solución alternativa y se recomienda a los usuarios actualizar al código parcheado","source":"nvd"}],"published":"2020-09-25T18:28:56.000Z","modified":"2026-09-08T08:48:19.898Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:H","score":8.1,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:H","score":8.1,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:H","score":8.1,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:H/SC:L/SI:L/SA:H","rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:H","score":8.1,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:M/Au:N/C:P/I:P/A:P","score":6.8,"rating":"MEDIUM"},{"scorer":"Bitnami Vulnerability Database","scheme":"rating","rating":"HIGH"}],"cwes":["CWE-787"],"affected":[{"ranges":[{"version":">= 2.2.0, < 2.2.1","status":"affected"},{"version":">= 2.3.0, < 2.3.1","status":"affected"}],"vendor":"tensorflow","product":"tensorflow","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"2.2.0","status":"affected","fixed":"2.2.1"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.3.0","status":"affected","fixed":"2.3.1"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.2.0","status":"affected","fixed":"2.2.1"}],"ecosystem":"PyPI","package":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.3.0","status":"affected","fixed":"2.3.1"}],"ecosystem":"PyPI","package":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.2.0","status":"affected","fixed":"2.2.1"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.3.0","status":"affected","fixed":"2.3.1"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"2.2.0","fixed":"2.2.1"},{"status":"affected","introduced":"2.3.0","fixed":"2.3.1"}],"vendor":"google","product":"tensorflow","cpe":"cpe:2.3:a:google:tensorflow:*:*:*:*:lite:*:*:*","source":"nvd"},{"ranges":[{"type":"git","introduced":"0","status":"affected","fixed":"204945b19e44b57906c9344c0d00120eeeae178a"},{"type":"ecosystem","introduced":"2.2.0","status":"affected","fixed":"2.2.1"},{"type":"ecosystem","introduced":"2.3.0","status":"affected","fixed":"2.3.1"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","repo":"https://github.com/tensorflow/tensorflow","source":"pysec"},{"ranges":[{"type":"git","introduced":"0","status":"affected","fixed":"204945b19e44b57906c9344c0d00120eeeae178a"},{"type":"ecosystem","introduced":"2.2.0","status":"affected","fixed":"2.2.1"},{"type":"ecosystem","introduced":"2.3.0","status":"affected","fixed":"2.3.1"}],"ecosystem":"PyPI","package":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","repo":"https://github.com/tensorflow/tensorflow","source":"pysec"},{"ranges":[{"type":"git","introduced":"0","status":"affected","fixed":"204945b19e44b57906c9344c0d00120eeeae178a"},{"type":"ecosystem","introduced":"2.2.0","status":"affected","fixed":"2.2.1"},{"type":"ecosystem","introduced":"2.3.0","status":"affected","fixed":"2.3.1"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","repo":"https://github.com/tensorflow/tensorflow","source":"pysec"},{"ranges":[{"type":"semver","introduced":"2.2.0","status":"affected","fixed":"2.2.1"},{"type":"semver","introduced":"2.3.0","status":"affected","fixed":"2.3.1"}],"ecosystem":"Bitnami","package":"tensorflow","purl":"pkg:bitnami/tensorflow","source":"bitnami"}],"references":[{"url":"https://github.com/tensorflow/tensorflow/releases/tag/v2.3.1","tags":["advisory","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec","bitnami"]},{"url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-p2cq-cprg-frvm","tags":["advisory","exploit","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec","bitnami"]},{"url":"https://github.com/tensorflow/tensorflow/commit/204945b19e44b57906c9344c0d00120eeeae178a","tags":["advisory","fix","patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec","bitnami"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2020-15214","tags":["advisory","web"],"sources":["ghsa","bitnami"]},{"url":"https://github.com/tensorflow/tensorflow/commit/00c7ed7ce81c2126ebc17dfe7073b5c0efd5ec0a","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/tensorflow/tensorflow/commit/a4030d8ba3692c438997c27be2dd95f3d5f54827","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-cpu/PYSEC-2020-294.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-gpu/PYSEC-2020-329.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow/PYSEC-2020-137.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/tensorflow/tensorflow","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/tensorflow/tensorflow/blob/0e68f4d3295eb0281a517c3662f6698992b7b2cf/tensorflow/lite/kernels/internal/reference/reference_ops.h#L2625-L2631","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/tensorflow/tensorflow/blob/0e68f4d3295eb0281a517c3662f6698992b7b2cf/tensorflow/lite/kernels/segment_sum.cc#L39-L44","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2020-15214","url":"https://www.cve.org/CVERecord?id=CVE-2020-15214","licence":"CVE Terms of Use","modified":"2024-08-04T13:08:22.895Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-p2cq-cprg-frvm","url":"https://github.com/advisories/GHSA-p2cq-cprg-frvm","licence":"CC-BY-4.0","modified":"2026-07-08T06:29:08.202Z"},{"source":"nvd","name":"NVD","id":"CVE-2020-15214","url":"https://nvd.nist.gov/vuln/detail/CVE-2020-15214","licence":"Public domain","modified":"2026-06-17T02:56:17.057Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2020-137","url":"https://osv.dev/vulnerability/PYSEC-2020-137","licence":"CC-BY-4.0","modified":"2023-12-06T01:00:17.486Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2020-294","url":"https://osv.dev/vulnerability/PYSEC-2020-294","licence":"CC-BY-4.0","modified":"2023-12-06T01:00:17.486Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2020-329","url":"https://osv.dev/vulnerability/PYSEC-2020-329","licence":"CC-BY-4.0","modified":"2023-12-06T01:00:17.486Z"},{"source":"bitnami","name":"Bitnami Vulnerability Database","id":"BIT-TENSORFLOW-2020-15214","url":"https://osv.dev/vulnerability/BIT-TENSORFLOW-2020-15214","licence":"Apache-2.0","modified":"2026-09-08T08:48:19.898Z"}],"updatedAt":"2026-11-25T22:57:54.961Z","epss":{"score":0.00671,"percentile":0.53288,"date":"2026-12-01T12:00:22.000Z"}}