{"id":"CVE-2021-37688","aliases":["CVE-2021-37688","GHSA-vcjj-9vg7-vf68","BIT-TENSORFLOW-2021-37688","PYSEC-2021-310","PYSEC-2021-601","PYSEC-2021-799"],"related":[],"kind":"vulnerability","state":"published","title":"Null pointer dereference in TensorFlow Lite","summary":"TensorFlow is an end-to-end open source platform for machine learning. In affected versions an attacker can craft a TFLite model that would trigger a null pointer dereference, which would result in a crash and denial of service. The [implementation](https://github.com/tensorflow/tensorflow/blob/149562d49faa709ea80df1d99fc41d005b81082a/tensorflow/lite/kernels/internal/optimized/optimized_ops.h#L268-L285) unconditionally dereferences a pointer. We have patched the issue in GitHub commit 15691e456c7dc9bd6be203b09765b063bf4a380c. 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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"TensorFlow is an end-to-end open source platform for machine learning. In affected versions an attacker can craft a TFLite model that would trigger a null pointer dereference, which would result in a crash and denial of service. The [implementation](https://github.com/tensorflow/tensorflow/blob/149562d49faa709ea80df1d99fc41d005b81082a/tensorflow/lite/kernels/internal/optimized/optimized_ops.h#L268-L285) unconditionally dereferences a pointer. We have patched the issue in GitHub commit 15691e456c7dc9bd6be203b09765b063bf4a380c. 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.","source":"cvelist"},{"lang":"en","text":"### Impact\nAn attacker can craft a TFLite model that would trigger a null pointer dereference, which would result in a crash and denial of service:\n\n```python\nimport tensorflow as tf\n\nmodel = tf.keras.models.Sequential()\nmodel.add(tf.keras.Input(shape=(1, 2, 3)))\nmodel.add(tf.keras.layers.Dense(0, activation='relu'))\n\nconverter = tf.lite.TFLiteConverter.from_keras_model(model)\ntflite_model = converter.convert()\n\ninterpreter = tf.lite.Interpreter(model_content=tflite_model)\ninterpreter.allocate_tensors()\n\ninterpreter.invoke()\n```\n\nThe [implementation](https://github.com/tensorflow/tensorflow/blob/149562d49faa709ea80df1d99fc41d005b81082a/tensorflow/lite/kernels/internal/optimized/optimized_ops.h#L268-L285) unconditionally dereferences a pointer.\n\n```cc\n  if (y4 > 1) {\n    // ...\n  } else {\n    for (int i0 = 0; i0 < y0; ++i0) {\n      const T* input2_data_ptr = nullptr;\n      for (int i1 = 0; i1 < y1; ++i1) {\n        input2_data_ptr = input2_data_reset;\n        for (int i2 = 0; i2 < y2; ++i2) {\n          scalar_broadcast_f(y3, params, *input1_data_ptr, input2_data_ptr,\n                             output_data_ptr);\n        }\n      }\n    }\n  }\n```\n\n### Patches\nWe have patched the issue in GitHub commit [15691e456c7dc9bd6be203b09765b063bf4a380c](https://github.com/tensorflow/tensorflow/commit/15691e456c7dc9bd6be203b09765b063bf4a380c).\n\nThe 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.\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 Yakun Zhang of Baidu Security.","format":"markdown","source":"ghsa"},{"lang":"es","text":"TensorFlow es una plataforma de código abierto de extremo a extremo para el aprendizaje automático. En las versiones afectadas, un atacante puede diseñar un modelo TFLite que podría desencadenar una desreferencia de puntero null, que resultaría en un bloqueo y una denegación de servicio. La [implementación](https://github.com/tensorflow/tensorflow/blob/149562d49faa709ea80df1d99fc41d005b81082a/tensorflow/lite/kernels/internal/optimized/optimized_ops.h#L268-L285) hace desreferencia incondicional a un puntero. Hemos parcheado el problema en el commit de GitHub 15691e456c7dc9bd6be203b09765b063bf4a380c. La corrección será incluida en TensorFlow versión 2.6.0. También seleccionaremos este commit en TensorFlow versión 2.5.1, TensorFlow versión 2.4.3, y TensorFlow versión 2.3.4, ya que estos también están afectados y todavía están en el rango de soporte.","source":"nvd"}],"published":"2021-08-12T22:00:12.000Z","modified":"2026-09-10T16:00:55.009Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:L/AC:L/Au:N/C:N/I:N/A:P","score":2.1,"rating":"LOW"},{"scorer":"Bitnami Vulnerability Database","scheme":"rating","rating":"HIGH"}],"cwes":["CWE-476"],"affected":[{"ranges":[{"version":">= 2.5.0, < 2.5.1","status":"affected"},{"version":">= 2.4.0, < 2.4.3","status":"affected"},{"version":"< 2.3.4","status":"affected"}],"vendor":"tensorflow","product":"tensorflow","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.3.4"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.4.0","status":"affected","fixed":"2.4.3"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.5.0","status":"affected","fixed":"2.5.1"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.5.0","status":"affected","fixed":"2.5.1"}],"ecosystem":"PyPI","package":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.4.0","status":"affected","fixed":"2.4.3"}],"ecosystem":"PyPI","package":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.3.4"}],"ecosystem":"PyPI","package":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.3.4"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.4.0","status":"affected","fixed":"2.4.3"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.5.0","status":"affected","fixed":"2.5.1"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"2.3.0","fixed":"2.3.4"},{"status":"affected","introduced":"2.4.0","fixed":"2.4.3"},{"status":"affected","version":"2.5.0"},{"status":"affected","version":"2.6.0"},{"status":"affected","version":"2.6.0"},{"status":"affected","version":"2.6.0"}],"vendor":"google","product":"tensorflow","cpe":"cpe:2.3:a:google:tensorflow:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"git","introduced":"0","status":"affected","fixed":"15691e456c7dc9bd6be203b09765b063bf4a380c"},{"type":"ecosystem","introduced":"2.3.0","status":"affected","fixed":"2.3.4"},{"type":"ecosystem","introduced":"2.4.0","status":"affected","fixed":"2.4.3"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","repo":"https://github.com/tensorflow/tensorflow","source":"pysec"},{"ranges":[{"type":"git","introduced":"0","status":"affected","fixed":"15691e456c7dc9bd6be203b09765b063bf4a380c"},{"type":"ecosystem","introduced":"2.3.0","status":"affected","fixed":"2.3.4"},{"type":"ecosystem","introduced":"2.4.0","status":"affected","fixed":"2.4.3"}],"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":"15691e456c7dc9bd6be203b09765b063bf4a380c"},{"type":"ecosystem","introduced":"2.3.0","status":"affected","fixed":"2.3.4"},{"type":"ecosystem","introduced":"2.4.0","status":"affected","fixed":"2.4.3"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","repo":"https://github.com/tensorflow/tensorflow","source":"pysec"},{"ranges":[{"type":"semver","introduced":"2.3.0","status":"affected","fixed":"2.3.4"},{"type":"semver","introduced":"2.4.0","status":"affected","fixed":"2.4.3"},{"type":"semver","introduced":"2.5.0","status":"affected","fixed":"2.5.1"}],"ecosystem":"Bitnami","package":"tensorflow","purl":"pkg:bitnami/tensorflow","source":"bitnami"}],"references":[{"url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-vcjj-9vg7-vf68","tags":["advisory","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec","bitnami"]},{"url":"https://github.com/tensorflow/tensorflow/commit/15691e456c7dc9bd6be203b09765b063bf4a380c","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-2021-37688","tags":["advisory","web"],"sources":["ghsa","bitnami"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-cpu/PYSEC-2021-601.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-gpu/PYSEC-2021-799.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow/PYSEC-2021-310.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/tensorflow/tensorflow","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/tensorflow/tensorflow/blob/149562d49faa709ea80df1d99fc41d005b81082a/tensorflow/lite/kernels/internal/optimized/optimized_ops.h#L268-L285","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-37688","url":"https://www.cve.org/CVERecord?id=CVE-2021-37688","licence":"CVE Terms of Use","modified":"2024-08-04T01:23:01.508Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-vcjj-9vg7-vf68","url":"https://github.com/advisories/GHSA-vcjj-9vg7-vf68","licence":"CC-BY-4.0","modified":"2026-09-10T03:49:08.399Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-37688","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-37688","licence":"Public domain","modified":"2026-06-17T04:00:59.273Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2021-310","url":"https://osv.dev/vulnerability/PYSEC-2021-310","licence":"CC-BY-4.0","modified":"2023-12-06T01:01:24.469Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2021-601","url":"https://osv.dev/vulnerability/PYSEC-2021-601","licence":"CC-BY-4.0","modified":"2023-12-06T01:01:24.469Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2021-799","url":"https://osv.dev/vulnerability/PYSEC-2021-799","licence":"CC-BY-4.0","modified":"2023-12-06T01:01:24.469Z"},{"source":"bitnami","name":"Bitnami Vulnerability Database","id":"BIT-TENSORFLOW-2021-37688","url":"https://osv.dev/vulnerability/BIT-TENSORFLOW-2021-37688","licence":"Apache-2.0","modified":"2026-09-10T16:00:55.009Z"}],"updatedAt":"2026-11-25T22:58:03.200Z","epss":{"score":0.00165,"percentile":0.05956,"date":"2026-12-01T12:00:22.000Z"}}