Skip to content
Heist/ feed
Back to feed
High

Security advisory

Type: advisorySources: OSVCVE: CVE-2020-15212

In TensorFlow Lite before versions 2.2.1 and 2.3.1, models using segment sum can trigger writes outside of bounds of heap allocated buffers by inserting negative elements in the segment ids tensor. Users having access to `segment_ids_data` can alter `output_index` and then write to outside of `output_data` buffer. This might result in a segmentation fault but it can also be used to further corrupt the memory and can be chained with other vulnerabilities to create more advanced 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 all positive, 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.

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

Source evidence

CVE-2020-15212

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 writes outside of bounds of heap allocated buffers by inserting negative elements in the segment ids tensor. Users having access to `segment_ids_data` can alter `output_index` and then write to outside of `output_data` buffer. This might result in a segmentation fault but it can also be used to further corrupt the memory and can be chained with other vulnerabilities to create more advanced 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 all positive, 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.

osv:CVE-2020-15212
Complete source record
{
  "id": "28f2f001649ed38c3d01c220a3e2d1f1ab53ec816ba7f52183a9e2bfde507f4a",
  "url": "https://osv.dev/vulnerability/CVE-2020-15212",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2020-15212",
    "summary": "In TensorFlow Lite before versions 2.2.1 and 2.3.1, models using segment sum can trigger writes outside of bounds of heap allocated buffers by inserting negative elements in the segment ids tensor. Users having access to `segment_ids_data` can alter `output_index` and then write to outside of `output_data` buffer. This might result in a segmentation fault but it can also be used to further corrupt the memory and can be chained with other vulnerabilities to create more advanced 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 all positive, 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.",
    "evidence": "osv:CVE-2020-15212",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2020-15212",
      "aliases": [
        "BIT-tensorflow-2020-15212",
        "CVE-2020-15212",
        "GHSA-hx2x-85gr-wrpq",
        "PYSEC-2020-135",
        "PYSEC-2020-292",
        "PYSEC-2020-327"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H"
        }
      ],
      "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-15212.json",
            "vanir_signatures": [
              {
                "id": "CVE-2020-15212-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-15212-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-15212-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:43Z"
          }
        }
      ],
      "modified": "2026-10-20T14:10:43.200253731Z",
      "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-hx2x-85gr-wrpq"
      ],
      "provider_metadata": {}
    },
    "related_cves": [
      {
        "value": "CVE-2020-15212",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 388643,
  "published_at": "2020-09-25T19:15:16.51+00:00"
}