CVE-2022-35996: TensorFlow Denial of Service Vulnerability in Conv2D
Summary
CVE-2022-35996: TensorFlow vulnerable to floating point exception in Conv2D. Affects tensorflow across 3 version ranges.
< 2.7.2
>= 2.8.0, < 2.8.1
>= 2.9.0, < 2.9.1
Fixed in 2.7.2, 2.8.1 or 2.9.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-35996 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 library developed by Google, widely used for building and training machine learning models. It provides a flexible ecosystem of tools, libraries, and community resources that allows researchers and developers to create and deploy machine learning applications. However, TensorFlow has a vulnerability in its Conv2D operation, which can lead to a denial of service if not addressed.
Vulnerability Detail
The vulnerability arises when the Conv2D function is provided with an empty input tensor while the filter and padding sizes are valid. This results in an output of all zeros, leading to division-by-zero floating point exceptions. Such exceptions can be exploited to trigger denial of service attacks, potentially disrupting services that rely on TensorFlow for processing.
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.7.22.7.2pip install --upgrade "tensorflow==2.7.2" -
>= 2.8.0, < 2.8.12.8.1pip install --upgrade "tensorflow==2.8.1" -
>= 2.9.0, < 2.9.12.9.1pip install --upgrade "tensorflow==2.9.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, ensure that the input tensor to the Conv2D operation is not empty. Here is an example of how to check the input before calling Conv2D:
import tensorflow as tf import numpy as np
input = np.ones([1, 0, 2, 1]) # Example of an empty input if input.shape[1] > 0: filter = np.ones([1, 1, 1, 1]) strides = [1, 1, 1, 1] padding = 'EXPLICIT' explicit_paddings = [0, 0, 1, 1, 1, 1, 0, 0] data_format = 'NHWC' res = tf.raw_ops.Conv2D( input=input, filter=filter, strides=strides, padding=padding, explicit_paddings=explicit_paddings, data_format=data_format,
)
else: print('Input tensor is empty, skipping Conv2D operation.')
Conclusion
The CVE-2022-35996 vulnerability in TensorFlow's Conv2D operation poses a risk of denial of service due to floating point exceptions when empty input tensors are used. Users are advised to update to the latest patched versions or implement workarounds to mitigate the risk.
See every vulnerability recorded for tensorflow →
FAQ
CVE-2022-35996 is a vulnerability in TensorFlow's Conv2D operation that can lead to denial of service due to floating point exceptions when provided with an empty input tensor.
You can use Vulert to monitor and alert for open-source vulnerabilities in your software. Check your application against the vulnerability using the Vulert playground without any signup.
The affected versions include TensorFlow 2.7.0 to 2.9.0. The vulnerability has been patched in TensorFlow 2.10.0 and also in 2.9.1, 2.8.1, and 2.7.2.
As a temporary workaround, ensure that the input tensor to the Conv2D operation is not empty to avoid triggering the vulnerability.
The CVSS score for this vulnerability is 5.9, indicating a moderate severity level.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.