{"id":"CVE-2021-29592","aliases":["CVE-2021-29592","GHSA-jjr8-m8g8-p6wv","BIT-TENSORFLOW-2021-29592","PYSEC-2021-229","PYSEC-2021-520","PYSEC-2021-718"],"related":[],"kind":"vulnerability","state":"published","title":"Null pointer dereference in TFLite's `Reshape` operator","summary":"TensorFlow is an end-to-end open source platform for machine learning. The fix for CVE-2020-15209(https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15209) missed the case when the target shape of `Reshape` operator is given by the elements of a 1-D tensor. As such, the fix for the vulnerability(https://github.com/tensorflow/tensorflow/blob/9c1dc920d8ffb4893d6c9d27d1f039607b326743/tensorflow/lite/core/subgraph.cc#L1062-L1074) allowed passing a null-buffer-backed tensor with a 1D shape. The fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2, TensorFlow 2.3.3, TensorFlow 2.2.3 and TensorFlow 2.1.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. The fix for CVE-2020-15209(https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15209) missed the case when the target shape of `Reshape` operator is given by the elements of a 1-D tensor. As such, the fix for the vulnerability(https://github.com/tensorflow/tensorflow/blob/9c1dc920d8ffb4893d6c9d27d1f039607b326743/tensorflow/lite/core/subgraph.cc#L1062-L1074) allowed passing a null-buffer-backed tensor with a 1D shape. The fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2, TensorFlow 2.3.3, TensorFlow 2.2.3 and TensorFlow 2.1.4, as these are also affected and still in supported range.","source":"cvelist"},{"lang":"en","text":"### Impact\nThe fix for [CVE-2020-15209](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15209) missed the case when the target shape of `Reshape` operator is given by the elements of a 1-D tensor. As such, the [fix for the vulnerability](https://github.com/tensorflow/tensorflow/blob/9c1dc920d8ffb4893d6c9d27d1f039607b326743/tensorflow/lite/core/subgraph.cc#L1062-L1074) allowed passing a null-buffer-backed tensor with a 1D shape:\n\n```cc\nif (tensor->data.raw == nullptr && tensor->bytes > 0) {\n  if (registration.builtin_code == kTfLiteBuiltinReshape && i == 1) {\n    // In general, having a tensor here with no buffer will be an error.\n    // However, for the reshape operator, the second input tensor is only\n    // used for the shape, not for the data. Thus, null buffer is ok.\n    continue;\n  } else {\n    // In all other cases, we need to return an error as otherwise we will\n    // trigger a null pointer dereference (likely).\n    ReportError(\"Input tensor %d lacks data\", tensor_index);\n    return kTfLiteError;\n  }\n}\n```\n\n### Patches\nWe have patched the issue in GitHub commit [f8378920345f4f4604202d4ab15ef64b2aceaa16](https://github.com/tensorflow/tensorflow/commit/f8378920345f4f4604202d4ab15ef64b2aceaa16).\n\nThe fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2, TensorFlow 2.3.3, TensorFlow 2.2.3 and TensorFlow 2.1.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 members of the Aivul Team from Qihoo 360.","format":"markdown","source":"ghsa"},{"lang":"es","text":"TensorFlow es una plataforma de código abierto de extremo a extremo para el aprendizaje automático.&#xa0;La corrección para CVE-2020-15209 (https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15209) pasó por alto el caso cuando la forma objetivo del operador \"Reshape\" viene dada por los elementos de un tensor 1-D.&#xa0;Como tal, la solución para la vulnerabilidad (https://github.com/tensorflow/tensorflow/blob/9c1dc920d8ffb4893d6c9d27d1f039607b326743/tensorflow/lite/core/subgraph.cc#L1062-L1074) permitió pasar un tensor respaldado por un búfer null con un Forma 1D.&#xa0;La corrección será incluida en TensorFlow versión 2.5.0.&#xa0;También seleccionaremos este commit en TensorFlow versión 2.4.2, TensorFlow versión 2.3.3, TensorFlow versión 2.2.3 y TensorFlow versión 2.1.4, ya que estos también están afectados y aún están en el rango compatible","source":"nvd"}],"published":"2021-05-14T19:22:22.000Z","modified":"2026-09-10T03:49:05.231Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L","score":4.4,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L","score":4.4,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L","score":4.4,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N","rating":"MEDIUM"},{"scorer":"NVD","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":"NVD","scheme":"CVSS:2.0","vector":"AV:L/AC:L/Au:N/C:P/I:P/A:P","score":4.6,"rating":"MEDIUM"},{"scorer":"Bitnami Vulnerability Database","scheme":"rating","rating":"HIGH"}],"cwes":["CWE-476"],"affected":[{"ranges":[{"version":"< 2.1.4","status":"affected"},{"version":">= 2.2.0, < 2.2.3","status":"affected"},{"version":">= 2.3.0, < 2.3.3","status":"affected"},{"version":">= 2.4.0, < 2.4.2","status":"affected"}],"vendor":"tensorflow","product":"tensorflow","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.1.4"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.2.0","status":"affected","fixed":"2.2.3"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.3.0","status":"affected","fixed":"2.3.3"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.4.0","status":"affected","fixed":"2.4.2"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.1.4"}],"ecosystem":"PyPI","package":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.2.0","status":"affected","fixed":"2.2.3"}],"ecosystem":"PyPI","package":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.3.0","status":"affected","fixed":"2.3.3"}],"ecosystem":"PyPI","package":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.4.0","status":"affected","fixed":"2.4.2"}],"ecosystem":"PyPI","package":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.1.4"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.2.0","status":"affected","fixed":"2.2.3"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.3.0","status":"affected","fixed":"2.3.3"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.4.0","status":"affected","fixed":"2.4.2"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"2.1.4"},{"status":"affected","introduced":"2.2.0","fixed":"2.2.3"},{"status":"affected","introduced":"2.3.0","fixed":"2.3.3"},{"status":"affected","introduced":"2.4.0","fixed":"2.4.2"}],"vendor":"google","product":"tensorflow","cpe":"cpe:2.3:a:google:tensorflow:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"git","introduced":"0","status":"affected","fixed":"f8378920345f4f4604202d4ab15ef64b2aceaa16"},{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.1.4"},{"type":"ecosystem","introduced":"2.2.0","status":"affected","fixed":"2.2.3"},{"type":"ecosystem","introduced":"2.3.0","status":"affected","fixed":"2.3.3"},{"type":"ecosystem","introduced":"2.4.0","status":"affected","fixed":"2.4.2"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","repo":"https://github.com/tensorflow/tensorflow","source":"pysec"},{"ranges":[{"type":"git","introduced":"0","status":"affected","fixed":"f8378920345f4f4604202d4ab15ef64b2aceaa16"},{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.1.4"},{"type":"ecosystem","introduced":"2.2.0","status":"affected","fixed":"2.2.3"},{"type":"ecosystem","introduced":"2.3.0","status":"affected","fixed":"2.3.3"},{"type":"ecosystem","introduced":"2.4.0","status":"affected","fixed":"2.4.2"}],"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":"f8378920345f4f4604202d4ab15ef64b2aceaa16"},{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.1.4"},{"type":"ecosystem","introduced":"2.2.0","status":"affected","fixed":"2.2.3"},{"type":"ecosystem","introduced":"2.3.0","status":"affected","fixed":"2.3.3"},{"type":"ecosystem","introduced":"2.4.0","status":"affected","fixed":"2.4.2"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","repo":"https://github.com/tensorflow/tensorflow","source":"pysec"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.1.4"},{"type":"semver","introduced":"2.2.0","status":"affected","fixed":"2.2.3"},{"type":"semver","introduced":"2.3.0","status":"affected","fixed":"2.3.3"},{"type":"semver","introduced":"2.4.0","status":"affected","fixed":"2.4.2"}],"ecosystem":"Bitnami","package":"tensorflow","purl":"pkg:bitnami/tensorflow","source":"bitnami"}],"references":[{"url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-jjr8-m8g8-p6wv","tags":["advisory","exploit","patch","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec","bitnami"]},{"url":"https://github.com/tensorflow/tensorflow/commit/f8378920345f4f4604202d4ab15ef64b2aceaa16","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-29592","tags":["advisory","web"],"sources":["ghsa","bitnami"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-cpu/PYSEC-2021-520.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-gpu/PYSEC-2021-718.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow/PYSEC-2021-229.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/tensorflow/tensorflow","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/tensorflow/tensorflow/blob/9c1dc920d8ffb4893d6c9d27d1f039607b326743/tensorflow/lite/core/subgraph.cc#L1062-L1074","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-29592","url":"https://www.cve.org/CVERecord?id=CVE-2021-29592","licence":"CVE Terms of Use","modified":"2024-08-03T22:11:06.276Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-jjr8-m8g8-p6wv","url":"https://github.com/advisories/GHSA-jjr8-m8g8-p6wv","licence":"CC-BY-4.0","modified":"2026-09-10T03:49:05.231Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-29592","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-29592","licence":"Public domain","modified":"2026-06-17T03:47:58.870Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2021-229","url":"https://osv.dev/vulnerability/PYSEC-2021-229","licence":"CC-BY-4.0","modified":"2023-12-06T01:01:08.158Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2021-520","url":"https://osv.dev/vulnerability/PYSEC-2021-520","licence":"CC-BY-4.0","modified":"2023-12-06T01:01:08.158Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2021-718","url":"https://osv.dev/vulnerability/PYSEC-2021-718","licence":"CC-BY-4.0","modified":"2023-12-06T01:01:08.158Z"},{"source":"bitnami","name":"Bitnami Vulnerability Database","id":"BIT-TENSORFLOW-2021-29592","url":"https://osv.dev/vulnerability/BIT-TENSORFLOW-2021-29592","licence":"Apache-2.0","modified":"2026-09-08T08:48:20.070Z"}],"updatedAt":"2026-11-25T22:58:01.409Z","epss":{"score":0.00215,"percentile":0.06922,"date":"2026-11-30T12:00:22.000Z"}}