Skip to content
Heist/ feed
Back to feed
Medium

Security advisory

Type: advisorySources: OSVCVE: CVE-2020-15213

In TensorFlow Lite before versions 2.2.1 and 2.3.1, models using segment sum can trigger a denial of service by causing an out of memory allocation in the implementation of segment sum. Since code uses the last element of the tensor holding them to determine the dimensionality of output tensor, attackers can use a very large value to trigger a large allocation. 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 limit the maximum value in the segment ids tensor. This only handles the case when the segment ids are stored statically in the model, but a similar validation could be done if the segment ids are generated at runtime, between inference steps. However, 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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2020-15213
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 12:39 UTC · Revision 1

Source evidence

CVE-2020-15213

core-osv · Original source

Published 25 Sept 2020, 19:15 UTC

In TensorFlow Lite before versions 2.2.1 and 2.3.1, models using segment sum can trigger a denial of service by causing an out of memory allocation in the implementation of segment sum. Since code uses the last element of the tensor holding them to determine the dimensionality of output tensor, attackers can use a very large value to trigger a large allocation. 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 limit the maximum value in the segment ids tensor. This only handles the case when the segment ids are stored statically in the model, but a similar validation could be done if the segment ids are generated at runtime, between inference steps. However, 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.

osv:CVE-2020-15213
Complete source record
{
  "id": "9c53cf0cd23579accd2cef51c5dc70de4f93d67d8f0a32d542e34fe944435bcb",
  "url": "https://osv.dev/vulnerability/CVE-2020-15213",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2020-15213",
    "summary": "In TensorFlow Lite before versions 2.2.1 and 2.3.1, models using segment sum can trigger a denial of service by causing an out of memory allocation in the implementation of segment sum. Since code uses the last element of the tensor holding them to determine the dimensionality of output tensor, attackers can use a very large value to trigger a large allocation. 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 limit the maximum value in the segment ids tensor. This only handles the case when the segment ids are stored statically in the model, but a similar validation could be done if the segment ids are generated at runtime, between inference steps. However, 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.",
    "evidence": "osv:CVE-2020-15213",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2020-15213",
      "aliases": [
        "BIT-tensorflow-2020-15213",
        "CVE-2020-15213",
        "GHSA-hjmq-236j-8m87",
        "PYSEC-2020-136",
        "PYSEC-2020-293",
        "PYSEC-2020-328"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:N/A:L"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/tensorflow/tensorflow",
              "type": "GIT",
              "events": [
                {
                  "introduced": "2b96f3662bd776e277f86997659e61046b56c315"
                },
                {
                  "fixed": "25fba035f3e453d94490932096282c7b0624bbb3"
                },
                {
                  "introduced": "b36436b087bd8e8701ef51718179037cccdfc26e"
                },
                {
                  "fixed": "fcc4b966f1265f466e82617020af93670141b009"
                },
                {
                  "fixed": "204945b19e44b57906c9344c0d00120eeeae178a"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:google:tensorflow:*:*:*:*:lite:*:*:*",
                    "range": [
                      {
                        "introduced": "2.2.0"
                      },
                      {
                        "fixed": "2.2.1"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "cpe": "cpe:2.3:a:google:tensorflow:*:*:*:*:lite:*:*:*",
                    "range": [
                      {
                        "introduced": "2.3.0"
                      },
                      {
                        "fixed": "2.3.1"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "204945b19e44b57906c9344c0d00120eeeae178a"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  },
                  {
                    "range": [
                      {
                        "fixed": "fcc4b966f1265f466e82617020af93670141b009"
                      }
                    ],
                    "source": "REFERENCES_TAG",
                    "original_tag": "v2.3.1"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v2.2.0",
            "v2.3.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2020-15213.json",
            "vanir_signatures": [
              {
                "id": "CVE-2020-15213-52684639",
                "digest": {
                  "threshold": 0.9,
                  "line_hashes": [
                    "101972797124021689281987725340951420668",
                    "201683876355472291189114228165797820445",
                    "211115368128421790584663460110504110559",
                    "217680514074416056930436943335463050468",
                    "98672107064172366153370090508856490407",
                    "312365468975337318428306797459355296745",
                    "109769402466749519282006345627816395581",
                    "270271510250316633290731012697965599223"
                  ]
                },
                "source": "https://github.com/tensorflow/tensorflow/commit/204945b19e44b57906c9344c0d00120eeeae178a",
                "target": {
                  "file": "tensorflow/lite/kernels/segment_sum.cc"
                },
                "deprecated": false,
                "signature_type": "Line",
                "signature_version": "v1"
              },
              {
                "id": "CVE-2020-15213-83df9c7c",
                "digest": {
                  "length": 499,
                  "function_hash": "42158381662736317977731229140612748319"
                },
                "source": "https://github.com/tensorflow/tensorflow/commit/204945b19e44b57906c9344c0d00120eeeae178a",
                "target": {
                  "file": "tensorflow/lite/kernels/segment_sum.cc",
                  "function": "ResizeOutputTensor"
                },
                "deprecated": false,
                "signature_type": "Function",
                "signature_version": "v1"
              },
              {
                "id": "CVE-2020-15213-bc1e6078",
                "digest": {
                  "threshold": 0.9,
                  "line_hashes": [
                    "22287067125757028589139043166053555711",
                    "37653588271508662778708658918209771606"
                  ]
                },
                "source": "https://github.com/tensorflow/tensorflow/commit/204945b19e44b57906c9344c0d00120eeeae178a",
                "target": {
                  "file": "tensorflow/lite/kernels/segment_sum_test.cc"
                },
                "deprecated": false,
                "signature_type": "Line",
                "signature_version": "v1"
              }
            ],
            "vanir_signatures_modified": "2026-10-20T14:10:47Z"
          }
        }
      ],
      "modified": "2026-10-20T14:10:47.991765746Z",
      "provider": "osv",
      "references": [
        "https://github.com/tensorflow/tensorflow/releases/tag/v2.3.1",
        "https://github.com/tensorflow/tensorflow/commit/204945b19e44b57906c9344c0d00120eeeae178a",
        "https://github.com/tensorflow/tensorflow/security/advisories/GHSA-hjmq-236j-8m87"
      ],
      "provider_metadata": {}
    },
    "related_cves": [
      {
        "value": "CVE-2020-15213",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 388657,
  "published_at": "2020-09-25T19:15:16.603+00:00"
}