{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2022-23563","id":"CVE-2022-23563","title":"Insecure temporary file in Tensorflow","description":"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). ","descriptionLong":"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.","published":"2022-02-04T22:32:38.000Z","updated":"2026-10-28T02:30:47.071677461Z","reserved":"2022-01-19T00:00:00.000Z","status":"Modified","rejected":false,"assigner":"GitHub_M","metric":{"version":"3.1","score":7.1,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N","rating":"high","source":"GitHub_M"},"metrics":[{"version":"4.0","score":null,"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","source":"GitHub"},{"version":"4.0","score":null,"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","source":"OSV"},{"version":"3.1","score":7.1,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N","rating":"high","source":"GitHub_M"},{"version":"3.1","score":7.1,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N","rating":"high","source":"github.com"},{"version":"3.1","score":6.3,"vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N","rating":"medium","source":"NVD"},{"version":"3.1","score":7.1,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N","rating":"high","source":"OSV"},{"version":"3.1","score":7.1,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N","rating":"high","source":"GitHub"},{"version":"2.0","score":3.3,"vector":"AV:L/AC:M/Au:N/C:P/I:P/A:N","rating":"low","source":"NVD"}],"rating":"high","products":["tensorflow"],"affectedProducts":[{"vendor":"tensorflow","product":"tensorflow","defaultStatus":null,"versions":[{"status":"affected","version":">= 2.7.0, < 2.7.1"},{"status":"affected","version":">= 2.6.0, < 2.6.3"},{"status":"affected","version":"< 2.5.3"}],"platforms":[]}],"packages":[{"ecosystem":"PyPI","name":"tensorflow","purl":"pkg:pypi/tensorflow","ranges":["<2.5.3",">=2.6.0 <2.6.3",">=2.7.0 <2.7.1"],"fixed":["2.5.3","2.6.3","2.7.1"],"advisory":"GHSA-wc4g-r73w-x8mm"},{"ecosystem":"PyPI","name":"tensorflow-cpu","purl":"pkg:pypi/tensorflow-cpu","ranges":["<2.5.3",">=2.6.0 <2.6.3",">=2.7.0 <2.7.1"],"fixed":["2.5.3","2.6.3","2.7.1"],"advisory":"GHSA-wc4g-r73w-x8mm"},{"ecosystem":"PyPI","name":"tensorflow-gpu","purl":"pkg:pypi/tensorflow-gpu","ranges":["<2.5.3",">=2.6.0 <2.6.3",">=2.7.0 <2.7.1"],"fixed":["2.5.3","2.6.3","2.7.1"],"advisory":"GHSA-wc4g-r73w-x8mm"}],"cwes":["CWE-367","CWE-668"],"aliases":["BIT-tensorflow-2022-23563","GHSA-wc4g-r73w-x8mm","PYSEC-2022-127","PYSEC-2022-72","PYSEC-2026-3253"],"references":[{"url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-wc4g-r73w-x8mm","tags":["x_refsource_CONFIRM","x_transferred","Third Party Advisory","advisory","web"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/23xxx/CVE-2022-23563.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-23563","tags":["advisory"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-cpu/PYSEC-2022-72.yaml","tags":["web"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-gpu/PYSEC-2022-127.yaml","tags":["web"]},{"url":"https://github.com/tensorflow/tensorflow","tags":["package"]},{"url":"https://pypi.org/project/tensorflow","tags":["package"]},{"url":"https://github.com/advisories/GHSA-wc4g-r73w-x8mm","tags":["advisory"]}],"patchReferenced":false,"fixAvailable":true,"exploitReferenced":false,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total"},"epss":0.0011,"epssPercentile":0.01339,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2022-23563","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-23563","ok":true,"note":"Modified"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2022-23563","ok":true,"note":"3 packages"},{"name":"GitHub Advisory","url":"https://github.com/advisories/GHSA-wc4g-r73w-x8mm","ok":true,"note":"GHSA-wc4g-r73w-x8mm"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2022-23563","ok":true,"note":"scored 2026-11-19"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}