{"id":"CVE-2021-41196","aliases":["CVE-2021-41196","GHSA-m539-j985-hcr8","BIT-TENSORFLOW-2021-41196","PYSEC-2021-389","PYSEC-2021-606","PYSEC-2021-804"],"related":[],"kind":"vulnerability","state":"published","title":"Crash in `max_pool3d` when size argument is 0 or negative","summary":"TensorFlow is an open source platform for machine learning. In affected versions the Keras pooling layers can trigger a segfault if the size of the pool is 0 or if a dimension is negative. This is due to the TensorFlow's implementation of pooling operations where the values in the sliding window are not checked to be strictly positive. The fix will be included in TensorFlow 2.7.0. We will also cherrypick this commit on TensorFlow 2.6.1, TensorFlow 2.5.2, and TensorFlow 2.4.4, as these are also affected and still in supported range.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"TensorFlow is an open source platform for machine learning. In affected versions the Keras pooling layers can trigger a segfault if the size of the pool is 0 or if a dimension is negative. This is due to the TensorFlow's implementation of pooling operations where the values in the sliding window are not checked to be strictly positive. The fix will be included in TensorFlow 2.7.0. We will also cherrypick this commit on TensorFlow 2.6.1, TensorFlow 2.5.2, and TensorFlow 2.4.4, as these are also affected and still in supported range.","source":"cvelist"},{"lang":"en","text":"### Impact\nThe Keras pooling layers can trigger a segfault if the size of the pool is 0 or if a dimension is negative: \n\n```python\nimport tensorflow as tf\n\npool_size = [2, 2, 0]\nlayer = tf.keras.layers.MaxPooling3D(strides=1, pool_size=pool_size)\ninput_tensor = tf.random.uniform([3, 4, 10, 11, 12], dtype=tf.float32)\nres = layer(input_tensor)\n```\n\nThis is due to the TensorFlow's implementation of pooling operations where the values in the sliding window are not checked to be strictly positive.\n\n### Patches\nWe have patched the issue in GitHub commit [12b1ff82b3f26ff8de17e58703231d5a02ef1b8b](https://github.com/tensorflow/tensorflow/commit/12b1ff82b3f26ff8de17e58703231d5a02ef1b8b) (merging [#51975](https://github.com/tensorflow/tensorflow/pull/51975)).\n\nThe fix will be included in TensorFlow 2.7.0. We will also cherrypick this commit on TensorFlow 2.6.1, TensorFlow 2.5.2, and TensorFlow 2.4.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 externally via a [GitHub issue](https://github.com/tensorflow/tensorflow/issues/51936).","format":"markdown","source":"ghsa"},{"lang":"es","text":"TensorFlow es una plataforma de código abierto para el aprendizaje automático. En las versiones afectadas, las capas de pooling de Keras pueden provocar un segfault si el tamaño del pool es 0 o si una dimensión es negativa. Esto es debido a la implementación de TensorFlow de las operaciones de pooling donde no es comprobado que los valores de la ventana deslizante sean estrictamente positivos. La corrección será incluida en TensorFlow versión 2.7.0. También será incluida este commit en TensorFlow versión 2.6.1, TensorFlow versión 2.5.2, y TensorFlow versión 2.4.4, ya que estos también están afectados y todavía están en el rango admitido","source":"nvd"}],"published":"2021-11-05T19:55:13.000Z","modified":"2026-09-08T08:48:16.686Z","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:N/A:H","score":5.5,"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:N/A:H","score":5.5,"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:N/A:H","score":5.5,"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:N/VA:H/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: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":"MEDIUM"}],"cwes":["CWE-191"],"affected":[{"ranges":[{"version":">= 2.6.0, < 2.6.1","status":"affected"},{"version":">= 2.5.0, < 2.5.2","status":"affected"},{"version":"< 2.4.4","status":"affected"}],"vendor":"tensorflow","product":"tensorflow","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"2.6.0","status":"affected","fixed":"2.6.1"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.5.0","status":"affected","fixed":"2.5.2"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.4.4"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.6.0","status":"affected","fixed":"2.6.1"}],"ecosystem":"PyPI","package":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.5.0","status":"affected","fixed":"2.5.2"}],"ecosystem":"PyPI","package":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.4.4"}],"ecosystem":"PyPI","package":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.6.0","status":"affected","fixed":"2.6.1"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.5.0","status":"affected","fixed":"2.5.2"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.4.4"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"2.4.4"},{"status":"affected","introduced":"2.5.0","fixed":"2.5.2"},{"status":"affected","introduced":"2.6.0","fixed":"2.6.1"}],"vendor":"google","product":"tensorflow","cpe":"cpe:2.3:a:google:tensorflow:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"git","introduced":"0","status":"affected","fixed":"12b1ff82b3f26ff8de17e58703231d5a02ef1b8b"},{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.4.4"},{"type":"ecosystem","introduced":"2.5.0","status":"affected","fixed":"2.5.2"},{"type":"ecosystem","introduced":"2.6.0","status":"affected","fixed":"2.6.1"},{"type":"ecosystem","introduced":"2.7.0rc0","status":"affected","fixed":"2.7.0"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","repo":"https://github.com/tensorflow/tensorflow","source":"pysec"},{"ranges":[{"type":"git","introduced":"0","status":"affected","fixed":"12b1ff82b3f26ff8de17e58703231d5a02ef1b8b"},{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.4.4"},{"type":"ecosystem","introduced":"2.5.0","status":"affected","fixed":"2.5.2"},{"type":"ecosystem","introduced":"2.6.0","status":"affected","fixed":"2.6.1"},{"type":"ecosystem","introduced":"2.7.0rc0","status":"affected","fixed":"2.7.0"}],"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":"12b1ff82b3f26ff8de17e58703231d5a02ef1b8b"},{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.4.4"},{"type":"ecosystem","introduced":"2.5.0","status":"affected","fixed":"2.5.2"},{"type":"ecosystem","introduced":"2.6.0","status":"affected","fixed":"2.6.1"},{"type":"ecosystem","introduced":"2.7.0rc0","status":"affected","fixed":"2.7.0"}],"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.4.4"},{"type":"semver","introduced":"2.5.0","status":"affected","fixed":"2.5.2"},{"type":"semver","introduced":"2.6.0","status":"affected","fixed":"2.6.1"}],"ecosystem":"Bitnami","package":"tensorflow","purl":"pkg:bitnami/tensorflow","source":"bitnami"}],"references":[{"url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-m539-j985-hcr8","tags":["advisory","exploit","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec","bitnami"]},{"url":"https://github.com/tensorflow/tensorflow/issues/51936","tags":["advisory","exploit","report","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec","bitnami"]},{"url":"https://github.com/tensorflow/tensorflow/commit/12b1ff82b3f26ff8de17e58703231d5a02ef1b8b","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-41196","tags":["advisory","web"],"sources":["ghsa","bitnami"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-cpu/PYSEC-2021-606.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-gpu/PYSEC-2021-804.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow/PYSEC-2021-389.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/tensorflow/tensorflow","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-41196","url":"https://www.cve.org/CVERecord?id=CVE-2021-41196","licence":"CVE Terms of Use","modified":"2024-08-04T03:08:31.485Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-m539-j985-hcr8","url":"https://github.com/advisories/GHSA-m539-j985-hcr8","licence":"CC-BY-4.0","modified":"2026-07-08T06:28:58.244Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-41196","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-41196","licence":"Public domain","modified":"2026-06-17T04:08:04.427Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2021-389","url":"https://osv.dev/vulnerability/PYSEC-2021-389","licence":"CC-BY-4.0","modified":"2023-12-06T01:01:33.508Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2021-606","url":"https://osv.dev/vulnerability/PYSEC-2021-606","licence":"CC-BY-4.0","modified":"2023-12-06T01:01:33.508Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2021-804","url":"https://osv.dev/vulnerability/PYSEC-2021-804","licence":"CC-BY-4.0","modified":"2023-12-06T01:01:33.508Z"},{"source":"bitnami","name":"Bitnami Vulnerability Database","id":"BIT-TENSORFLOW-2021-41196","url":"https://osv.dev/vulnerability/BIT-TENSORFLOW-2021-41196","licence":"Apache-2.0","modified":"2026-09-08T08:48:16.686Z"}],"updatedAt":"2026-11-25T22:58:05.381Z","epss":{"score":0.00238,"percentile":0.15845,"date":"2026-12-01T12:00:22.000Z"}}