CVE-2022-23563 Insecure temporary file in Tensorflow

High 7.1 Published Updated

A race condition in TensorFlow's temporary file creation allows attackers to hijack files, potentially leading to code execution or privilege escalation.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2022-23563?

CVE-2022-23563 is a high-severity vulnerability in Google Tensorflow, published on 4 Feb 2022. It can only be exploited from the same machine or local network, with no action from the victim.

Official 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). 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.

Weakness: CWE-367

Which versions are affected by CVE-2022-23563?

22 open source packages ship an affected version, including tensorflow, tensorflow-cpu and tensorflow-gpu. It affects 1 product.

PackageAffectedFixed in
tensorflow BitnamiAll versions2.5.3, 2.6.3, 2.7.1
tensorflow PyPIAll versions2.5.3, 2.6.3, 2.7.1
tensorflow PyPIAll versions2.5.3
tensorflow PyPIAll versions2.5.3
tensorflow PyPIFrom 2.6.02.6.3
tensorflow PyPIFrom 2.6.02.6.3
16 more packages
tensorflow PyPIFrom 2.7.02.7.1
tensorflow PyPIFrom 2.7.02.7.1
tensorflow-cpu PyPIAll versions2.5.3, 2.6.3
tensorflow-cpu PyPIAll versions2.5.3
tensorflow-cpu PyPIAll versions2.5.3
tensorflow-cpu PyPIFrom 2.6.02.6.3
tensorflow-cpu PyPIFrom 2.6.02.6.3
tensorflow-cpu PyPIFrom 2.7.02.7.1
tensorflow-cpu PyPIFrom 2.7.02.7.1
tensorflow-gpu PyPIAll versions2.5.3, 2.6.3
tensorflow-gpu PyPIAll versions2.5.3
tensorflow-gpu PyPIAll versions2.5.3
tensorflow-gpu PyPIFrom 2.6.02.6.3
tensorflow-gpu PyPIFrom 2.6.02.6.3
tensorflow-gpu PyPIFrom 2.7.02.7.1
tensorflow-gpu PyPIFrom 2.7.02.7.1

Products include Google Tensorflow.

How do I fix CVE-2022-23563?

Upgrade tensorflow to a fixed version for your release line: 2.5.3, 2.6.3 or 2.7.1.

Is CVE-2022-23563 being exploited?

There is no known exploitation of CVE-2022-23563 in the wild and no public exploit code.

All Google Tensorflow vulnerabilities

Sources

Also known as BIT-tensorflow-2022-23563, GHSA-wc4g-r73w-x8mm, PYSEC-2022-127, PYSEC-2022-72, PYSEC-2026-3253.

Is CVE-2022-23563 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free