CVE-2022-23573: Uninitialized variable access in Tensorflow

tensorflow Updated 02 Oct 2025

Summary

09/02/2022
Yes i
High
7.6

CVE-2022-23573: Uninitialized variable access 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-23573 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 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 could lead to uninitialized variable access, resulting in undefined behavior and potential security risks.

Vulnerability Detail

The vulnerability in Tensorflow arises from the implementation of the AssignOp function. This function copies uninitialized data to a new tensor, which can lead to unpredictable and potentially malicious behavior. While the implementation checks the initialization of the left-hand side of the assignment, it fails to verify the initialization of the right-hand side. This oversight can be exploited by an attacker to manipulate data and compromise the integrity and security of the system.

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

As a workaround, users can temporarily mitigate the risk by avoiding the usage of uninitialized variables in their Tensorflow code. It is recommended to initialize all variables before using them to prevent potential vulnerabilities. Here is an example of how to initialize a variable in Tensorflow:

import tensorflow as tf

# Define a variable
my_variable = tf.Variable(0)

# Initialize the variable
init_op = tf.global_variables_initializer()

# Run the initialization operation
with tf.Session() as sess:
    sess.run(init_op)

By following this approach, users can ensure that variables are properly initialized and minimize the risk of encountering the vulnerability.

Conclusion

The vulnerability in Tensorflow that allows uninitialized variable access poses a significant security risk. It is crucial for users to update their Tensorflow installations to the patched versions to mitigate the vulnerability. Additionally, initializing variables before usage and following best practices for secure coding can further reduce the risk of encountering similar vulnerabilities. For further support and assistance in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for tensorflow →

Share this vulnerability

FAQ

The vulnerability can result in uninitialized data being copied to a new tensor, leading to undefined behavior. This can be exploited by an attacker to manipulate data and potentially compromise the security and integrity of the system.

The vulnerability affects Tensorflow versions 2.5.3, 2.6.3, 2.7.1, and prior. Users of these versions should update to the patched versions to mitigate the risk.

At the time of this advisory, there are no known public exploits targeting this vulnerability. However, it is important to apply the necessary patches and updates to prevent potential exploitation.

You can use the Vulert Playground (https://vulert.com/scanner) to check if your Tensorflow installation is affected by this vulnerability. Simply upload your Pipfile.lock file to the playground, and it will analyze and alert you if any open-source vulnerabilities, including this one, are detected.

For more information about Tensorflow security, including how to report issues and contact the Tensorflow team, please refer to the official Tensorflow security guide: https://github.com/tensorflow/tensorflow/blob/master/SECURITY.md

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