Skip to content
Heist/ feed
Back to feed
High

Security advisory

Type: advisorySources: OSVCVE: CVE-2021-37681

TensorFlow is an end-to-end open source platform for machine learning. In affected versions the implementation of SVDF in TFLite is [vulnerable to a null pointer error](https://github.com/tensorflow/tensorflow/blob/460e000de3a83278fb00b61a16d161b1964f15f4/tensorflow/lite/kernels/svdf.cc#L300-L313). The [`GetVariableInput` function](https://github.com/tensorflow/tensorflow/blob/460e000de3a83278fb00b61a16d161b1964f15f4/tensorflow/lite/kernels/kernel_util.cc#L115-L119) can return a null pointer but `GetTensorData` assumes that the argument is always a valid tensor. Furthermore, because `GetVariableInput` calls [`GetMutableInput`](https://github.com/tensorflow/tensorflow/blob/460e000de3a83278fb00b61a16d161b1964f15f4/tensorflow/lite/kernels/kernel_util.cc#L82-L90) which might return `nullptr`, the `tensor->is_variable` expression can also trigger a null pointer exception. We have patched the issue in GitHub commit 5b048e87e4e55990dae6b547add4dae59f4e1c76. The fix will be included in TensorFlow 2.6.0. We will also cherrypick this commit on TensorFlow 2.5.1, TensorFlow 2.4.3, and TensorFlow 2.3.4, as these are also affected and still in supported range.

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

Source evidence

CVE-2021-37681

core-osv · Original source

Published 12 Aug 2021, 22:15 UTC

TensorFlow is an end-to-end open source platform for machine learning. In affected versions the implementation of SVDF in TFLite is [vulnerable to a null pointer error](https://github.com/tensorflow/tensorflow/blob/460e000de3a83278fb00b61a16d161b1964f15f4/tensorflow/lite/kernels/svdf.cc#L300-L313). The [`GetVariableInput` function](https://github.com/tensorflow/tensorflow/blob/460e000de3a83278fb00b61a16d161b1964f15f4/tensorflow/lite/kernels/kernel_util.cc#L115-L119) can return a null pointer but `GetTensorData` assumes that the argument is always a valid tensor. Furthermore, because `GetVariableInput` calls [`GetMutableInput`](https://github.com/tensorflow/tensorflow/blob/460e000de3a83278fb00b61a16d161b1964f15f4/tensorflow/lite/kernels/kernel_util.cc#L82-L90) which might return `nullptr`, the `tensor->is_variable` expression can also trigger a null pointer exception. We have patched the issue in GitHub commit 5b048e87e4e55990dae6b547add4dae59f4e1c76. The fix will be included in TensorFlow 2.6.0. We will also cherrypick this commit on TensorFlow 2.5.1, TensorFlow 2.4.3, and TensorFlow 2.3.4, as these are also affected and still in supported range.

osv:CVE-2021-37681
Complete source record
{
  "id": "b49fce02ee718b06e0fe32985a485a0f5859f46565fb302561111c2e6b55c530",
  "url": "https://osv.dev/vulnerability/CVE-2021-37681",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2021-37681",
    "summary": "TensorFlow is an end-to-end open source platform for machine learning. In affected versions the implementation of SVDF in TFLite is [vulnerable to a null pointer error](https://github.com/tensorflow/tensorflow/blob/460e000de3a83278fb00b61a16d161b1964f15f4/tensorflow/lite/kernels/svdf.cc#L300-L313). The [`GetVariableInput` function](https://github.com/tensorflow/tensorflow/blob/460e000de3a83278fb00b61a16d161b1964f15f4/tensorflow/lite/kernels/kernel_util.cc#L115-L119) can return a null pointer but `GetTensorData` assumes that the argument is always a valid tensor. Furthermore, because `GetVariableInput` calls [`GetMutableInput`](https://github.com/tensorflow/tensorflow/blob/460e000de3a83278fb00b61a16d161b1964f15f4/tensorflow/lite/kernels/kernel_util.cc#L82-L90) which might return `nullptr`, the `tensor->is_variable` expression can also trigger a null pointer exception. We have patched the issue in GitHub commit 5b048e87e4e55990dae6b547add4dae59f4e1c76. The fix will be included in TensorFlow 2.6.0. We will also cherrypick this commit on TensorFlow 2.5.1, TensorFlow 2.4.3, and TensorFlow 2.3.4, as these are also affected and still in supported range.",
    "evidence": "osv:CVE-2021-37681",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2021-37681",
      "aliases": [
        "BIT-tensorflow-2021-37681",
        "CVE-2021-37681",
        "GHSA-7xwj-5r4v-429p",
        "PYSEC-2021-303",
        "PYSEC-2021-594",
        "PYSEC-2021-792"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/tensorflow/tensorflow",
              "type": "GIT",
              "events": [
                {
                  "introduced": "b36436b087bd8e8701ef51718179037cccdfc26e"
                },
                {
                  "fixed": "7462dcaae1e8cfe1dfd0c62dd6083f9749a9d827"
                },
                {
                  "introduced": "582c8d236cb079023657287c318ff26adb239002"
                },
                {
                  "fixed": "4c0b84bf2a714bcdd18da1f1f94d533d72399d52"
                },
                {
                  "introduced": "a4dfb8d1a71385bd6d122e4f27f86dcebb96712d"
                },
                {
                  "last_affected": "5368d50428b30b7c9ccd038aec65d09252d16596"
                },
                {
                  "fixed": "5b048e87e4e55990dae6b547add4dae59f4e1c76"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:google:tensorflow:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "2.3.0"
                      },
                      {
                        "fixed": "2.3.4"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "cpe": "cpe:2.3:a:google:tensorflow:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "2.4.0"
                      },
                      {
                        "fixed": "2.4.3"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "cpe": "cpe:2.3:a:google:tensorflow:2.5.0:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "2.5.0"
                      },
                      {
                        "last_affected": "2.5.0"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "cpe": "cpe:2.3:a:google:tensorflow:2.6.0:rc0:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "2.6.0-rc0"
                      },
                      {
                        "last_affected": "2.6.0-rc0"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "cpe": "cpe:2.3:a:google:tensorflow:2.6.0:rc1:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "2.6.0-rc1"
                      },
                      {
                        "last_affected": "2.6.0-rc1"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "cpe": "cpe:2.3:a:google:tensorflow:2.6.0:rc2:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "2.6.0-rc2"
                      },
                      {
                        "last_affected": "2.6.0-rc2"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "range": [
                      {
                        "fixed": "5b048e87e4e55990dae6b547add4dae59f4e1c76"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "2.5.0",
            "2.6.0-rc0",
            "2.6.0-rc1",
            "2.6.0-rc2",
            "v2.3.3",
            "v2.4.2",
            "v2.3.2",
            "v2.4.1",
            "v2.4.0",
            "v2.3.1",
            "v2.3.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-37681.json",
            "vanir_signatures": [
              {
                "id": "CVE-2021-37681-02a04b81",
                "digest": {
                  "length": 3763,
                  "function_hash": "277771564071844196417094966686928471885"
                },
                "source": "https://github.com/tensorflow/tensorflow/commit/5b048e87e4e55990dae6b547add4dae59f4e1c76",
                "target": {
                  "file": "tensorflow/lite/kernels/svdf.cc",
                  "function": "Eval"
                },
                "deprecated": false,
                "signature_type": "Function",
                "signature_version": "v1"
              },
              {
                "id": "CVE-2021-37681-33364e90",
                "digest": {
                  "threshold": 0.9,
                  "line_hashes": [
                    "171307121571642068695454032622458007569",
                    "29941410466284478930787366860551228937",
                    "221556527070209520502004048032332303571",
                    "199258940345129842197877996600733491640"
                  ]
                },
                "source": "https://github.com/tensorflow/tensorflow/commit/5b048e87e4e55990dae6b547add4dae59f4e1c76",
                "target": {
                  "file": "tensorflow/lite/kernels/svdf.cc"
                },
                "deprecated": false,
                "signature_type": "Line",
                "signature_version": "v1"
              },
              {
                "id": "CVE-2021-37681-41806392",
                "digest": {
                  "length": 169,
                  "function_hash": "99754822290123940257327233292511093096"
                },
                "source": "https://github.com/tensorflow/tensorflow/commit/5b048e87e4e55990dae6b547add4dae59f4e1c76",
                "target": {
                  "file": "tensorflow/lite/kernels/kernel_util.cc",
                  "function": "GetVariableInput"
                },
                "deprecated": false,
                "signature_type": "Function",
                "signature_version": "v1"
              },
              {
                "id": "CVE-2021-37681-e23df497",
                "digest": {
                  "threshold": 0.9,
                  "line_hashes": [
                    "187287587552228953845727315607235521446",
                    "286719328079571892617242822217036577720",
                    "326163651760032361359206415215756972294",
                    "132640206525196469370031657143121165862"
                  ]
                },
                "source": "https://github.com/tensorflow/tensorflow/commit/5b048e87e4e55990dae6b547add4dae59f4e1c76",
                "target": {
                  "file": "tensorflow/lite/kernels/kernel_util.cc"
                },
                "deprecated": false,
                "signature_type": "Line",
                "signature_version": "v1"
              }
            ],
            "vanir_signatures_modified": "2026-10-20T14:28:19Z"
          }
        }
      ],
      "modified": "2026-10-20T14:28:19.197797192Z",
      "provider": "osv",
      "references": [
        "https://github.com/tensorflow/tensorflow/security/advisories/GHSA-7xwj-5r4v-429p",
        "https://github.com/tensorflow/tensorflow/commit/5b048e87e4e55990dae6b547add4dae59f4e1c76"
      ],
      "provider_metadata": {}
    },
    "related_cves": [
      {
        "value": "CVE-2021-37681",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 389036,
  "published_at": "2021-08-12T22:15:08.867+00:00"
}