{"id":"CVE-2020-26267","aliases":["CVE-2020-26267","GHSA-c9f3-9wfr-wgh7","BIT-TENSORFLOW-2020-26267","PYSEC-2020-140","PYSEC-2020-298","PYSEC-2020-333"],"related":[],"kind":"vulnerability","state":"published","title":"Lack of validation in data format attributes in TensorFlow","summary":"In affected versions of TensorFlow the tf.raw_ops.DataFormatVecPermute API does not validate the src_format and dst_format attributes. The code assumes that these two arguments define a permutation of NHWC. This can result in uninitialized memory accesses, read outside of bounds and even crashes. This is fixed in versions 1.15.5, 2.0.4, 2.1.3, 2.2.2, 2.3.2, and 2.4.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In affected versions of TensorFlow the tf.raw_ops.DataFormatVecPermute API does not validate the src_format and dst_format attributes. The code assumes that these two arguments define a permutation of NHWC. This can result in uninitialized memory accesses, read outside of bounds and even crashes. This is fixed in versions 1.15.5, 2.0.4, 2.1.3, 2.2.2, 2.3.2, and 2.4.0.","source":"cvelist"},{"lang":"en","text":"### Impact\nThe `tf.raw_ops.DataFormatVecPermute` API does not validate the `src_format` and `dst_format` attributes. [The code](https://github.com/tensorflow/tensorflow/blob/304b96815324e6a73d046df10df6626d63ac12ad/tensorflow/core/kernels/data_format_ops.cc) assumes that these two arguments define a permutation of `NHWC`.\n\nHowever, these assumptions are not checked and this can result in uninitialized memory accesses, read outside of bounds and even crashes.\n\n```python\n>>> import tensorflow as tf\n>>> tf.raw_ops.DataFormatVecPermute(x=[1,4], src_format='1234', dst_format='1234')\n<tf.Tensor: shape=(2,), dtype=int32, numpy=array([4, 757100143], dtype=int32)>\n...\n>>> tf.raw_ops.DataFormatVecPermute(x=[1,4], src_format='HHHH', dst_format='WWWW')\n<tf.Tensor: shape=(2,), dtype=int32, numpy=array([4, 32701], dtype=int32)>\n...\n>>> tf.raw_ops.DataFormatVecPermute(x=[1,4], src_format='H', dst_format='W')\n<tf.Tensor: shape=(2,), dtype=int32, numpy=array([4, 32701], dtype=int32)>\n>>> tf.raw_ops.DataFormatVecPermute(x=[1,2,3,4], \n                                    src_format='1234', dst_format='1253')\n<tf.Tensor: shape=(4,), dtype=int32, numpy=array([4, 2, 939037184, 3], dtype=int32)>\n...\n>>> tf.raw_ops.DataFormatVecPermute(x=[1,2,3,4],\n                                    src_format='1234', dst_format='1223')\n<tf.Tensor: shape=(4,), dtype=int32, numpy=array([4, 32701, 2, 3], dtype=int32)>\n...\n>>> tf.raw_ops.DataFormatVecPermute(x=[1,2,3,4],\n                                    src_format='1224', dst_format='1423')\n<tf.Tensor: shape=(4,), dtype=int32, numpy=array([1, 4, 3, 32701], dtype=int32)>\n...\n>>> tf.raw_ops.DataFormatVecPermute(x=[1,2,3,4], src_format='1234', dst_format='432')\n<tf.Tensor: shape=(4,), dtype=int32, numpy=array([4, 3, 2, 32701], dtype=int32)>\n...\n>>> tf.raw_ops.DataFormatVecPermute(x=[1,2,3,4],\n                                    src_format='12345678', dst_format='87654321')\nmunmap_chunk(): invalid pointer\nAborted\n...\n>>> tf.raw_ops.DataFormatVecPermute(x=[[1,5],[2,6],[3,7],[4,8]],           \n                                    src_format='12345678', dst_format='87654321')\n<tf.Tensor: shape=(4, 2), dtype=int32, numpy=\narray([[71364624,        0],\n       [71365824,        0],\n       [     560,        0],\n       [      48,        0]], dtype=int32)>\n...\n>>> tf.raw_ops.DataFormatVecPermute(x=[[1,5],[2,6],[3,7],[4,8]], \n                                    src_format='12345678', dst_format='87654321')\nfree(): invalid next size (fast)\nAborted\n```\n\nA similar issue occurs in `tf.raw_ops.DataFormatDimMap`, for the same reasons:\n\n```python\n>>> tf.raw_ops.DataFormatDimMap(x=[[1,5],[2,6],[3,7],[4,8]], src_format='1234',\n>>> dst_format='8765')\n<tf.Tensor: shape=(4, 2), dtype=int32, numpy=\narray([[1954047348, 1954047348],\n       [1852793646, 1852793646],\n       [1954047348, 1954047348],\n       [1852793632, 1852793632]], dtype=int32)>\n```\n\n### Patches\nWe have patched the issue in GitHub commit [ebc70b7a592420d3d2f359e4b1694c236b82c7ae](https://github.com/tensorflow/tensorflow/commit/ebc70b7a592420d3d2f359e4b1694c236b82c7ae) and will release TensorFlow 2.4.0 containing the patch. TensorFlow nightly packages after this commit will also have the issue resolved.\n\nSince this issue also impacts TF versions before 2.4, we will patch all releases between 1.15 and 2.3 inclusive.\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":"En las versiones afectadas de TensorFlow, la API tf.raw_ops.DataFormatVecPermute no comprueba los atributos src_format y dst_format.&#xa0;El código asume que estos dos argumentos definen una permutación de NHWC.&#xa0;Esto puede resultar en accesos de memoria no inicializados, lectura fuera de límites e incluso fallos.&#xa0;Esto es corregido en las versiones 1.15.5, 2.0.4, 2.1.3, 2.2.2, 2.3.2 y 2.4.0.","source":"nvd"}],"published":"2020-12-10T19:07:26.000Z","modified":"2026-09-10T03:49:00.769Z","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":"LOW"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N","rating":"LOW"},{"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:S/C:P/I:P/A:P","score":4.3,"rating":"MEDIUM"},{"scorer":"Bitnami Vulnerability Database","scheme":"rating","rating":"HIGH"}],"cwes":["CWE-125"],"affected":[{"ranges":[{"version":"< 1.15.5","status":"affected"},{"version":">= 2.0.0, < 2.0.4","status":"affected"},{"version":">= 2.1.0, < 2.1.3","status":"affected"},{"version":">= 2.2.0, < 2.2.2","status":"affected"},{"version":">= 2.3.0, < 2.3.2","status":"affected"}],"vendor":"tensorflow","product":"tensorflow","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.15.5"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.0.0","status":"affected","fixed":"2.0.4"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.1.0","status":"affected","fixed":"2.1.3"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.2.0","status":"affected","fixed":"2.2.2"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.3.0","status":"affected","fixed":"2.3.2"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.15.5"}],"ecosystem":"PyPI","package":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.0.0","status":"affected","fixed":"2.0.4"}],"ecosystem":"PyPI","package":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.1.0","status":"affected","fixed":"2.1.3"}],"ecosystem":"PyPI","package":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.2.0","status":"affected","fixed":"2.2.2"}],"ecosystem":"PyPI","package":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.3.0","status":"affected","fixed":"2.3.2"}],"ecosystem":"PyPI","package":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.15.5"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.0.0","status":"affected","fixed":"2.0.4"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.1.0","status":"affected","fixed":"2.1.3"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.2.0","status":"affected","fixed":"2.2.2"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.3.0","status":"affected","fixed":"2.3.2"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"1.15.5"},{"status":"affected","introduced":"2.0.0","fixed":"2.0.4"},{"status":"affected","introduced":"2.1.0","fixed":"2.1.3"},{"status":"affected","introduced":"2.2.0","fixed":"2.2.2"},{"status":"affected","introduced":"2.3.0","fixed":"2.3.2"}],"vendor":"google","product":"tensorflow","cpe":"cpe:2.3:a:google:tensorflow:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"git","introduced":"0","status":"affected","fixed":"ebc70b7a592420d3d2f359e4b1694c236b82c7ae"},{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.15.5"},{"type":"ecosystem","introduced":"2.0.0","status":"affected","fixed":"2.0.4"},{"type":"ecosystem","introduced":"2.1.0","status":"affected","fixed":"2.1.3"},{"type":"ecosystem","introduced":"2.2.0","status":"affected","fixed":"2.2.2"},{"type":"ecosystem","introduced":"2.3.0","status":"affected","fixed":"2.3.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":"ebc70b7a592420d3d2f359e4b1694c236b82c7ae"},{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.15.5"},{"type":"ecosystem","introduced":"2.0.0","status":"affected","fixed":"2.0.4"},{"type":"ecosystem","introduced":"2.1.0","status":"affected","fixed":"2.1.3"},{"type":"ecosystem","introduced":"2.2.0","status":"affected","fixed":"2.2.2"},{"type":"ecosystem","introduced":"2.3.0","status":"affected","fixed":"2.3.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":"ebc70b7a592420d3d2f359e4b1694c236b82c7ae"},{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.15.5"},{"type":"ecosystem","introduced":"2.0.0","status":"affected","fixed":"2.0.4"},{"type":"ecosystem","introduced":"2.1.0","status":"affected","fixed":"2.1.3"},{"type":"ecosystem","introduced":"2.2.0","status":"affected","fixed":"2.2.2"},{"type":"ecosystem","introduced":"2.3.0","status":"affected","fixed":"2.3.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":"1.15.5"},{"type":"semver","introduced":"2.0.0","status":"affected","fixed":"2.0.4"},{"type":"semver","introduced":"2.1.0","status":"affected","fixed":"2.1.3"},{"type":"semver","introduced":"2.2.0","status":"affected","fixed":"2.2.2"},{"type":"semver","introduced":"2.3.0","status":"affected","fixed":"2.3.2"}],"ecosystem":"Bitnami","package":"tensorflow","purl":"pkg:bitnami/tensorflow","source":"bitnami"}],"references":[{"url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-c9f3-9wfr-wgh7","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/ebc70b7a592420d3d2f359e4b1694c236b82c7ae","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-2020-26267","tags":["advisory","web"],"sources":["ghsa","bitnami"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-cpu/PYSEC-2020-298.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-gpu/PYSEC-2020-333.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow/PYSEC-2020-140.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-2020-26267","url":"https://www.cve.org/CVERecord?id=CVE-2020-26267","licence":"CVE Terms of Use","modified":"2024-08-04T15:56:04.539Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-c9f3-9wfr-wgh7","url":"https://github.com/advisories/GHSA-c9f3-9wfr-wgh7","licence":"CC-BY-4.0","modified":"2026-09-10T03:49:00.769Z"},{"source":"nvd","name":"NVD","id":"CVE-2020-26267","url":"https://nvd.nist.gov/vuln/detail/CVE-2020-26267","licence":"Public domain","modified":"2026-06-17T03:07:57.653Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2020-140","url":"https://osv.dev/vulnerability/PYSEC-2020-140","licence":"CC-BY-4.0","modified":"2023-12-06T01:00:27.687Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2020-298","url":"https://osv.dev/vulnerability/PYSEC-2020-298","licence":"CC-BY-4.0","modified":"2023-12-06T01:00:27.687Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2020-333","url":"https://osv.dev/vulnerability/PYSEC-2020-333","licence":"CC-BY-4.0","modified":"2023-12-06T01:00:27.687Z"},{"source":"bitnami","name":"Bitnami Vulnerability Database","id":"BIT-TENSORFLOW-2020-26267","url":"https://osv.dev/vulnerability/BIT-TENSORFLOW-2020-26267","licence":"Apache-2.0","modified":"2026-09-08T08:48:19.898Z"}],"updatedAt":"2026-11-25T22:57:56.152Z","epss":{"score":0.00243,"percentile":0.16648,"date":"2026-12-01T12:00:22.000Z"}}