{"id":"CVE-2022-23563","aliases":["CVE-2022-23563","GHSA-wc4g-r73w-x8mm","BIT-TENSORFLOW-2022-23563","PYSEC-2022-127","PYSEC-2022-72","PYSEC-2026-3253"],"related":[],"kind":"vulnerability","state":"published","title":"Insecure temporary file in Tensorflow","summary":"Tensorflow is an Open Source Machine Learning Framework. In multiple places, TensorFlow uses `tempfile.mktemp` to create temporary files. While this is acceptable in testing, in utilities and libraries it is dangerous as a different process can create the file between the check for the filename in `mktemp` and the actual creation of the file by a subsequent operation (a TOC/TOU type of weakness). In several instances, TensorFlow was supposed to actually create a temporary directory instead of a file. This logic bug is hidden away by the `mktemp` function usage. We have patched the issue in several commits, replacing `mktemp` with the safer `mkstemp`/`mkdtemp` functions, according to the usage pattern. Users are advised to upgrade as soon as possible.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Tensorflow is an Open Source Machine Learning Framework. In multiple places, TensorFlow uses `tempfile.mktemp` to create temporary files. While this is acceptable in testing, in utilities and libraries it is dangerous as a different process can create the file between the check for the filename in `mktemp` and the actual creation of the file by a subsequent operation (a TOC/TOU type of weakness). In several instances, TensorFlow was supposed to actually create a temporary directory instead of a file. This logic bug is hidden away by the `mktemp` function usage. We have patched the issue in several commits, replacing `mktemp` with the safer `mkstemp`/`mkdtemp` functions, according to the usage pattern. Users are advised to upgrade as soon as possible.","source":"cvelist"},{"lang":"en","text":"### Impact\nIn multiple places, TensorFlow uses `tempfile.mktemp` to create temporary files. While this is acceptable in testing, in utilities and libraries it is dangerous as a different process can create the file between the check for the filename in `mktemp` and the actual creation of the file by a subsequent operation (a TOC/TOU type of weakness).\n\nIn several instances, TensorFlow was supposed to actually create a temporary directory instead of a file. This logic bug is hidden away by the `mktemp` function usage.\n\n### Patches\nWe have patched the issue in several commits, replacing `mktemp` with the safer `mkstemp`/`mkdtemp` functions, according to the usage pattern.\nThe fix will be included in TensorFlow 2.8.0. We will also cherrypick this commit on TensorFlow 2.7.1, TensorFlow 2.6.3, and TensorFlow 2.5.3, 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 on huntr.dev for one scenario and discovered via variant analysis on other instances.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Tensorflow es un Marco de Aprendizaje Automático de Código Abierto. En varios lugares, TensorFlow usa \"tempfile.mktemp\" para crear archivos temporales. Mientras que esto es aceptable en las pruebas, en las utilidades y bibliotecas es peligroso ya que un proceso diferente puede crear el archivo entre la comprobación del nombre del archivo en \"mktemp\" y la creación real del archivo por una operación posterior (una debilidad del tipo TOC/TOU). En varios casos, se supone que TensorFlow debería crear un directorio temporal en lugar de un archivo. Este error lógico está oculto por el uso de la función \"mktemp\". Hemos parcheado el problema en varios commits, sustituyendo \"mktemp\" por las funciones más seguras \"mkstemp\"/\"mkdtemp\", de acuerdo con el patrón de uso. Se recomienda a usuarios que actualicen lo antes posible","source":"nvd"}],"published":"2022-02-04T22:32:38.000Z","modified":"2026-09-10T16:00:55.045Z","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:N","score":7.1,"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:N","score":7.1,"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:N","score":7.1,"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:N/SC:N/SI:N/SA:N","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N","score":6.3,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:L/AC:M/Au:N/C:P/I:P/A:N","score":3.3,"rating":"LOW"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N","score":7.1,"rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N"},{"scorer":"Bitnami Vulnerability Database","scheme":"rating","rating":"HIGH"}],"cwes":["CWE-367","CWE-668"],"affected":[{"ranges":[{"version":">= 2.7.0, < 2.7.1","status":"affected"},{"version":">= 2.6.0, < 2.6.3","status":"affected"},{"version":"< 2.5.3","status":"affected"}],"vendor":"tensorflow","product":"tensorflow","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.5.3"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.6.0","status":"affected","fixed":"2.6.3"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.7.0","status":"affected","fixed":"2.7.1"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.5.3"}],"ecosystem":"PyPI","package":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.6.0","status":"affected","fixed":"2.6.3"}],"ecosystem":"PyPI","package":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.7.0","status":"affected","fixed":"2.7.1"}],"ecosystem":"PyPI","package":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.5.3"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.6.0","status":"affected","fixed":"2.6.3"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.7.0","status":"affected","fixed":"2.7.1"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","source":"ghsa"},{"ranges":[{"status":"affected","lastAffected":"2.5.2"},{"status":"affected","introduced":"2.6.0","lastAffected":"2.6.2"},{"status":"affected","version":"2.7.0"}],"vendor":"google","product":"tensorflow","cpe":"cpe:2.3:a:google:tensorflow:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.5.3"},{"type":"ecosystem","introduced":"2.6.0","status":"affected","fixed":"2.6.3"}],"ecosystem":"PyPI","package":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","source":"pysec"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.5.3"},{"type":"ecosystem","introduced":"2.6.0","status":"affected","fixed":"2.6.3"}],"ecosystem":"PyPI","package":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","source":"pysec"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.5.3"},{"type":"ecosystem","introduced":"2.6.0","status":"affected","fixed":"2.6.3"},{"type":"ecosystem","introduced":"2.7.0","status":"affected","fixed":"2.7.1"}],"ecosystem":"PyPI","package":"tensorflow","purl":"pkg:pypi/tensorflow","source":"pysec"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.5.3"},{"type":"semver","introduced":"2.6.0","status":"affected","fixed":"2.6.3"},{"type":"semver","introduced":"2.7.0","status":"affected","fixed":"2.7.1"}],"ecosystem":"Bitnami","package":"tensorflow","purl":"pkg:bitnami/tensorflow","source":"bitnami"}],"references":[{"url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-wc4g-r73w-x8mm","tags":["advisory","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec","bitnami"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-23563","tags":["advisory","web"],"sources":["ghsa","pysec","bitnami"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-cpu/PYSEC-2022-72.yaml","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-gpu/PYSEC-2022-127.yaml","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://github.com/tensorflow/tensorflow","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/tensorflow","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-wc4g-r73w-x8mm","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2025-04-23T15:56:31.754Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-23563","url":"https://www.cve.org/CVERecord?id=CVE-2022-23563","licence":"CVE Terms of Use","modified":"2025-04-23T19:07:51.891Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-wc4g-r73w-x8mm","url":"https://github.com/advisories/GHSA-wc4g-r73w-x8mm","licence":"CC-BY-4.0","modified":"2026-07-13T16:43:48.511Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-23563","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-23563","licence":"Public domain","modified":"2026-06-17T04:30:21.920Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2022-127","url":"https://osv.dev/vulnerability/PYSEC-2022-127","licence":"CC-BY-4.0","modified":"2026-07-13T16:43:48.511Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2022-72","url":"https://osv.dev/vulnerability/PYSEC-2022-72","licence":"CC-BY-4.0","modified":"2026-07-13T16:43:48.511Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-3253","url":"https://osv.dev/vulnerability/PYSEC-2026-3253","licence":"CC-BY-4.0","modified":"2026-07-13T16:43:48.511Z"},{"source":"bitnami","name":"Bitnami Vulnerability Database","id":"BIT-TENSORFLOW-2022-23563","url":"https://osv.dev/vulnerability/BIT-TENSORFLOW-2022-23563","licence":"Apache-2.0","modified":"2026-09-10T16:00:55.045Z"}],"updatedAt":"2026-11-25T22:58:09.509Z","epss":{"score":0.00114,"percentile":0.0164,"date":"2026-12-01T12:00:22.000Z"}}