CVE-2022-29201: TensorFlow - Missing validation results in undefined behavior in QuantizedConv2D
Summary
CVE-2022-29201: Missing validation results in undefined behavior in QuantizedConv2D. Affects tensorflow across 3 version ranges.
< 2.6.4
>= 2.7.0, < 2.7.2
>= 2.8.0, < 2.8.1
Fixed in 2.6.4, 2.7.2 or 2.8.1, depending on the release line you run. How to fix ↓
Also tracked for
- tensorflow-cpu · PyPI
- tensorflow-gpu · PyPI
- tensorflow · Bitnami
The same CVE-2022-29201 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 that provides a comprehensive ecosystem of tools, libraries, and community resources. It is widely used for various applications, including deep learning, neural networks, and natural language processing. The vulnerability identified as CVE-2022-29201 affects the QuantizedConv2D function in TensorFlow, which is responsible for performing quantized convolution operations. This vulnerability arises due to missing validation in the input arguments of the function, leading to undefined behavior and potential security risks.
Vulnerability Detail
The vulnerability in the QuantizedConv2D function of TensorFlow arises from the lack of proper validation of input arguments. When certain arguments are empty or invalid, references within the function are bound to nullptr, resulting in undefined behavior. An attacker could potentially exploit this vulnerability to cause a denial-of-service (DoS) attack or execute arbitrary code. The impact of this vulnerability can vary depending on the context in which TensorFlow is used, but it poses a moderate risk to the security and stability of affected systems.
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.6.42.6.4pip install --upgrade "tensorflow==2.6.4" -
>= 2.7.0, < 2.7.22.7.2pip install --upgrade "tensorflow==2.7.2" -
>= 2.8.0, < 2.8.12.8.1pip install --upgrade "tensorflow==2.8.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 temporary workaround, users can avoid the vulnerability by ensuring that the input arguments provided to the QuantizedConv2D function are valid and non-empty. This can be achieved by validating the input data and filters before passing them to the function. Here is an example of how to perform the validation in Python:
import tensorflow as tf
input = tf.constant(1, shape=[1, 2, 3, 3], dtype=tf.quint8)
filter = tf.constant(1, shape=[1, 2, 3, 3], dtype=tf.quint8)
# Validate input arguments
if input.size > 0 and filter.size > 0:
# Call QuantizedConv2D function
tf.raw_ops.QuantizedConv2D(
input=input,
filter=filter,
min_input=min_input,
max_input=max_input,
min_filter=min_filter,
max_filter=max_filter,
strides=[1, 1, 1, 1],
padding="SAME"
)
else:
print("Invalid input arguments")
By performing this validation, the vulnerability can be mitigated until the TensorFlow package is updated to a patched version.
Conclusion
The vulnerability identified as CVE-2022-29201 in TensorFlow's QuantizedConv2D function can lead to undefined behavior and potential security risks. It is recommended to update the TensorFlow package to one of the patched versions (2.6.4, 2.7.2, or 2.8.1) to mitigate the vulnerability. Users can also implement a temporary workaround by validating the input arguments before calling the function. For further support and assistance in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for tensorflow →
FAQ
TensorFlow is an open-source machine learning framework that provides tools and libraries for building and deploying machine learning models.
The QuantizedConv2D function in TensorFlow is responsible for performing quantized convolution operations, which are commonly used in deep learning and image processing tasks.
The vulnerability in QuantizedConv2D arises from missing validation in the input arguments, leading to undefined behavior and potential security risks in TensorFlow.
The vulnerability could be exploited by an attacker to cause a denial-of-service (DoS) attack or execute arbitrary code, posing a moderate risk to affected systems.
To fix the vulnerability, users should update their TensorFlow installation to one of the patched versions: TensorFlow 2.6.4, TensorFlow 2.7.2, or TensorFlow 2.8.1.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.