CVE-2022-23573: Uninitialized variable access in Tensorflow
Summary
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
- tensorflow · Bitnami
- tensorflow-gpu · PyPI
- tensorflow-cpu · PyPI
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.
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.
No signup required · Results in about 60 seconds
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.32.5.3pip install --upgrade "tensorflow==2.5.3" -
>= 2.6.0, < 2.6.32.6.3pip install --upgrade "tensorflow==2.6.3" -
>= 2.7.0, < 2.7.12.7.1pip 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 →
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
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.