{"id":"CVE-2022-23563","published":"2022-02-04T22:32:38Z","modified":"2025-04-23T19:07:51Z","title":"Insecure temporary file in Tensorflow","vendor":"tensorflow","product":"tensorflow","tier":"tail","description":{"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.1,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.0011,"percentile":0.01338,"provenance":"source"},"cwes":[{"id":"CWE-367","name":"Time-of-check Time-of-use (TOCTOU) Race Condition"}],"references":[{"url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-wc4g-r73w-x8mm","tags":["x_refsource_CONFIRM"]}],"priority":{"score":5.2,"factors":[{"name":"EPSS percentile","points":0.27},{"name":"CVSS severity","points":4.97}]},"vendorSlug":"tensorflow","affectedVersions":[{"vendor":"tensorflow","product":"tensorflow","versions":[">= 2.7.0, < 2.7.1",">= 2.6.0, < 2.6.3","< 2.5.3"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total","timestamp":"2025-04-23T15:56:31.754325Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"tensorflow","vulnerableRanges":["<2.5.3",">=2.6.0, <2.6.3",">=2.7.0, <2.7.1"],"patched":["2.5.3","2.6.3","2.7.1"],"from":["GHSA-wc4g-r73w-x8mm","PYSEC-2026-3253"],"provenance":"source"},{"ecosystem":"PyPI","package":"tensorflow-cpu","vulnerableRanges":["<2.5.3",">=2.6.0, <2.6.3",">=2.7.0, <2.7.1"],"patched":["2.5.3","2.6.3","2.7.1"],"from":["GHSA-wc4g-r73w-x8mm","PYSEC-2022-72"],"provenance":"source"},{"ecosystem":"PyPI","package":"tensorflow-gpu","vulnerableRanges":["<2.5.3",">=2.6.0, <2.6.3",">=2.7.0, <2.7.1"],"patched":["2.5.3","2.6.3","2.7.1"],"from":["GHSA-wc4g-r73w-x8mm","PYSEC-2022-127"],"provenance":"source"}],"summary":{"text":"TensorFlow, the open-source machine learning framework, contains a time-of-check to time-of-use race condition in several places where it creates temporary files with the insecure tempfile.mktemp function, and in some cases it should have created a temporary directory instead. An attacker with local access and low privileges can exploit this by creating a file or link under the predicted name between the existence check and the actual creation, which can lead to high confidentiality and integrity impact, and no user interaction is required.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:18:38Z"},"euvd":{"id":"EUVD-2022-0311","exploited":false,"provenance":"source"}}