CVE-2022-23563: TensorFlow GPU - Insecure Usage of tempfile.mktemp

tensorflow-gpu Updated 02 Oct 2025

Summary

04/02/2022
Yes i
Unrated
Not published

CVE-2022-23563: Tensorflow is an Open Source Machine Learning Framework. Affects tensorflow-gpu across 2 version ranges.

< 2.5.3 >= 2.6.0, < 2.6.3

Fixed in 2.5.3 or 2.6.3, depending on the release line you run. How to fix ↓

Also tracked for

The same CVE-2022-23563 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

TensorFlow is an open-source machine learning framework widely used for developing and deploying machine learning models. It provides a comprehensive set of tools and libraries for building and training neural networks. TensorFlow GPU is a variant of TensorFlow that leverages GPU acceleration for faster computation.

Vulnerability Detail

The vulnerability (CVE-2022-23563) in TensorFlow GPU arises from the insecure usage of the tempfile.mktemp function to create temporary files. This function is intended for testing purposes and can lead to a time-of-check to time-of-use (TOCTOU) vulnerability. In certain instances, TensorFlow incorrectly uses mktemp to create temporary files instead of directories, which can allow a different process to create a file with the same name before TensorFlow creates it. This logic flaw is masked by the usage of mktemp. The issue has been addressed in several commits by replacing mktemp with the safer mkstemp or mkdtemp functions, depending on the specific usage pattern.

How To Fix

Latest published version: 2.12.0 as of 22 Oct 2026

pip install --upgrade "tensorflow-gpu==2.12.0"

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 2.5.3 2.5.3
    pip install --upgrade "tensorflow-gpu==2.5.3"
  • >= 2.6.0, < 2.6.3 2.6.3
    pip install --upgrade "tensorflow-gpu==2.6.3"

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

There is no specific workaround provided for this vulnerability. The recommended solution is to upgrade to the patched version of TensorFlow GPU.

Conclusion

The vulnerability (CVE-2022-23563) in TensorFlow GPU arises from the insecure usage of tempfile.mktemp to create temporary files. Upgrading to TensorFlow GPU version 2.6.3 or later resolves this issue by replacing the insecure function with safer alternatives. It is recommended to upgrade to the latest version to ensure the security of your TensorFlow GPU installation. For further support on vulnerability remediation, you can reach out to DevNack.com.

See every vulnerability recorded for tensorflow-gpu →

Share this vulnerability

FAQ

TensorFlow GPU is a variant of TensorFlow that utilizes GPU acceleration for faster computation. It is commonly used in machine learning applications that require high-performance computing.

The vulnerability can potentially allow an attacker to manipulate or access temporary files created by TensorFlow GPU. This could lead to unauthorized access, data leakage, or other security breaches.

You can use Vulert's vulnerability monitoring service to check if your application is affected by this vulnerability. Vulert analyzes your Pipfile.lock and provides real-time alerts for open-source vulnerabilities, including this one.

Yes, the TensorFlow team has released a fix for this vulnerability in version 2.6.3. It is recommended to upgrade to this version or later to ensure the vulnerability is addressed.

There are no known exploits for this vulnerability at the time of this report. However, it is important to apply the recommended fix to mitigate any potential risks.

Related vulnerabilities

Recent vulnerabilities recorded for tensorflow-gpu.

How To Fix

Latest published version: 2.12.0 as of 22 Oct 2026

pip install --upgrade "tensorflow-gpu==2.12.0"

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 2.5.3 2.5.3
    pip install --upgrade "tensorflow-gpu==2.5.3"
  • >= 2.6.0, < 2.6.3 2.6.3
    pip install --upgrade "tensorflow-gpu==2.6.3"

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback