CVE-2022-23573: TensorFlow AssignOp Uninitialized Data Copying
Summary
CVE-2022-23573: Tensorflow is an Open Source Machine Learning Framework. Affects tensorflow-cpu across 3 version ranges.
< 2.5.3
>= 2.6.0, < 2.6.3
< ef1d027be116f25e25bb94a60da491c2cf55bd0b
Fixed in 2.5.3 or 2.6.3, depending on the release line you run. How to fix ↓
Also tracked for
- tensorflow · PyPI
- tensorflow · Bitnami
- tensorflow · PyPI
- tensorflow-gpu · 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 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 is known for its flexibility, scalability, and extensive community support. However, a vulnerability has been identified in the implementation of the AssignOp operation, which can lead to the copying of uninitialized data to a new tensor. This uninitialized data can cause undefined behavior and potential security risks.
Vulnerability Detail
The vulnerability arises from a lack of proper initialization checks in the AssignOp implementation. While the left-hand side of the assignment is checked for initialization to minimize allocations, the right-hand side is not. This oversight allows uninitialized data to be copied, leading to unpredictable behavior. Attackers could potentially exploit this vulnerability to manipulate or extract sensitive information, compromise model integrity, or cause denial-of-service attacks. The issue has been addressed in TensorFlow 2.8.0, and fixes have been backported to TensorFlow 2.7.1, TensorFlow 2.6.3, and TensorFlow 2.5.3.
How To Fix
Latest published version: 2.21.0 as of 22 Oct 2026
pip install --upgrade "tensorflow-cpu==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-cpu==2.5.3" -
>= 2.6.0, < 2.6.32.6.3pip install --upgrade "tensorflow-cpu==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
As a temporary workaround, users can manually initialize the tensors involved in the AssignOp operation before performing the assignment. This can be achieved by explicitly setting the values of the tensors to valid initial values. Here's an example in Python:
import tensorflow as tf
# Initialize the tensors
lhs_tensor = tf.zeros([10, 10])
rhs_tensor = tf.ones([10, 10])
# Perform the assignment
assign_op = tf.assign(lhs_tensor, rhs_tensor)
# Continue with the rest of the code
By ensuring proper initialization, the vulnerability can be mitigated until the TensorFlow update is applied.
Conclusion
The vulnerability in TensorFlow's AssignOp operation can lead to the copying of uninitialized data, resulting in undefined behavior and potential security risks. It is crucial to update TensorFlow to version 2.8.0 or apply the provided patches to mitigate this vulnerability. Failure to address this issue may expose machine learning models to attacks and compromise the integrity of the system. For further support and assistance in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for tensorflow-cpu →
FAQ
TensorFlow is an open-source machine learning framework used for developing and deploying machine learning models. It provides a comprehensive set of tools and libraries for building and training neural networks.
AssignOp is an operation in TensorFlow that performs the assignment of one tensor to another. It is commonly used for updating the values of tensors during training or inference.
The vulnerability can result in the copying of uninitialized data to a new tensor, leading to undefined behavior. This can be exploited by attackers to manipulate or extract sensitive information, compromise model integrity, or cause denial-of-service attacks.
The vulnerability affects TensorFlow versions 2.5.3, 2.6.3, and 2.7.1. These versions have been patched in TensorFlow 2.8.0.
To fix this vulnerability, it is recommended to update TensorFlow to version 2.8.0 or apply the respective patches for TensorFlow 2.7.1, TensorFlow 2.6.3, and TensorFlow 2.5.3. Upgrading to the latest version ensures that the uninitialized data copying issue is resolved.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow-cpu.