PT-2022-16079 · Google · Tensorflow

Published

2022-02-04

·

Updated

2024-03-06

·

CVE-2022-23563

CVSS v4.0

8.4

High

VectorAV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N
Name of the Vulnerable Software and Affected Versions TensorFlow versions prior to 2.8.0 TensorFlow versions 2.7.0 through 2.7.0 (will be patched in 2.7.1) TensorFlow versions 2.6.0 through 2.6.2 (will be patched in 2.6.3) TensorFlow versions 2.5.0 through 2.5.2 (will be patched in 2.5.3)
Description The issue arises from TensorFlow's use of tempfile.mktemp to create temporary files, which can be dangerous in utilities and libraries 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, resulting in a TOC/TOU type of weakness. In several instances, TensorFlow was supposed to create a temporary directory instead of a file, but this logic bug is hidden away by the mktemp function usage.
Recommendations For TensorFlow versions prior to 2.8.0, upgrade to version 2.8.0 or later as soon as possible. For TensorFlow versions 2.7.0 through 2.7.0, upgrade to version 2.7.1 or later. For TensorFlow versions 2.6.0 through 2.6.2, upgrade to version 2.6.3 or later. For TensorFlow versions 2.5.0 through 2.5.2, upgrade to version 2.5.3 or later. As a temporary workaround, consider replacing tempfile.mktemp with the safer mkstemp/mkdtemp functions, according to the usage pattern, until a patch is available.

Exploit

Fix

Exposure of Resource to Wrong Sphere

Time Of Check To Time Of Use

Weakness Enumeration

Related Identifiers

BIT-TENSORFLOW-2022-23563
CVE-2022-23563
GHSA-WC4G-R73W-X8MM
OPENSUSE-SU-2024:12116-1
PYSEC-2022-127
PYSEC-2022-72

Affected Products

Tensorflow