CVE-2022-23563: Insecure temporary file in TensorFlow

tensorflow Updated 02 Oct 2025

Summary

09/02/2022
Yes i
High
7.1

CVE-2022-23563: Insecure temporary file in Tensorflow. Affects tensorflow across 3 version ranges.

< 2.5.3 >= 2.6.0, < 2.6.3 >= 2.7.0, < 2.7.1

Fixed in 2.5.3, 2.6.3 or 2.7.1, 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 Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

TensorFlow is an open-source machine learning framework developed by Google. It provides a comprehensive ecosystem of tools, libraries, and resources for building and deploying machine learning models. TensorFlow is widely used in various domains, including research, industry, and academia. However, a vulnerability has been discovered in TensorFlow that involves the insecure creation of temporary files.

Vulnerability Detail

The vulnerability in TensorFlow arises from the use of the tempfile.mktemp function to create temporary files. This function is intended for testing purposes and is not suitable for use in utilities and libraries. The issue occurs when a different process creates a file with the same name between the check for the filename in mktemp and the actual creation of the file. This vulnerability is a time-of-check to time-of-use (TOCTOU) weakness. In several instances, TensorFlow was supposed to create a temporary directory instead of a file, but this logic bug was hidden by the usage of mktemp. The impact of this vulnerability can be significant, as it can lead to unauthorized access, data leakage, or other security breaches.

How To Fix

Latest published version: 2.21.0 as of 22 Oct 2026

pip install --upgrade "tensorflow==2.21.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==2.5.3"
  • >= 2.6.0, < 2.6.3 2.6.3
    pip install --upgrade "tensorflow==2.6.3"
  • >= 2.7.0, < 2.7.1 2.7.1
    pip install --upgrade "tensorflow==2.7.1"

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. Users are advised to update their TensorFlow installation to the patched versions mentioned above.

Conclusion

In conclusion, the vulnerability in TensorFlow involving insecure temporary file creation has been addressed by the TensorFlow team. Users are advised to update their TensorFlow installation to the patched versions to mitigate the risk of unauthorized access and other security breaches. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for tensorflow →

Share this vulnerability

FAQ

TensorFlow is an open-source machine learning framework developed by Google. It provides tools and libraries for building and deploying machine learning models.

The vulnerability can lead to unauthorized access, data leakage, or other security breaches.

To fix this vulnerability, update your TensorFlow installation to version 2.8.0 or later.

There are no specific workarounds provided for this vulnerability. Updating to the patched versions is recommended.

Versions 2.5.3, 2.6.3, and 2.7.1 of TensorFlow are affected by this vulnerability.

Related vulnerabilities

Recent vulnerabilities recorded for tensorflow.

How To Fix

Latest published version: 2.21.0 as of 22 Oct 2026

pip install --upgrade "tensorflow==2.21.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==2.5.3"
  • >= 2.6.0, < 2.6.3 2.6.3
    pip install --upgrade "tensorflow==2.6.3"
  • >= 2.7.0, < 2.7.1 2.7.1
    pip install --upgrade "tensorflow==2.7.1"

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