CVE-2022-35993: TensorFlow CHECK Fail in SetSize Leading to Denial of Service
Summary
CVE-2022-35993: TensorFlow vulnerable to CHECK fail in SetSize. Affects tensorflow-cpu 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 · PyPI
- tensorflow-gpu · PyPI
- tensorflow · Bitnami
- tensorflow · PyPI
The same CVE-2022-35993 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 various applications such as deep learning and neural networks. It provides flexible tools, libraries, and community resources that let researchers push the state-of-the-art in ML, and developers easily build and deploy ML-powered applications. However, TensorFlow has a vulnerability in the SetSize operation that can lead to denial of service attacks if exploited.
Vulnerability Detail
The vulnerability arises when the SetSize function receives an input set_shape that is not a 1D tensor, resulting in a CHECK failure. This failure can be exploited to trigger a denial of service attack, causing the application to crash or become unresponsive. The vulnerability is particularly concerning as it can be triggered with minimal input, making it a potential target for attackers looking to disrupt services.
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.7.22.7.2pip install --upgrade "tensorflow-cpu==2.7.2" -
>= 2.8.0, < 2.8.12.8.1pip install --upgrade "tensorflow-cpu==2.8.1" -
>= 2.9.0, < 2.9.12.9.1pip install --upgrade "tensorflow-cpu==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 to the SetSize function is always a 1D tensor. For example, modify your code as follows:
import tensorflow as tf
arg_0 = 1
arg_1 = [1]
arg_2 = 1
arg_3 = True
arg_4 = ''
tf.raw_ops.SetSize(set_indices=arg_0, set_values=arg_1, set_shape=arg_2,
validate_indices=arg_3, name=arg_4)
Conclusion
In summary, CVE-2022-35993 is a significant vulnerability in TensorFlow that can lead to denial of service attacks. It is crucial to update to the patched versions to ensure the security of applications using TensorFlow. Additionally, using tools like Vulert can help monitor for such vulnerabilities in real-time.
See every vulnerability recorded for tensorflow-cpu →
FAQ
CVE-2022-35993 is a vulnerability in TensorFlow that can lead to denial of service due to a CHECK failure in the SetSize function when provided with incorrect input.
You can check if your application is affected by using Vulert, which monitors and alerts for open-source vulnerabilities in real-time. Visit Vulert Scanner to use the Vulert playground without signup.
The affected versions include TensorFlow 2.7.0 to 2.9.0. The vulnerability has been patched in versions 2.10.0, 2.9.1, 2.8.1, and 2.7.2.
The CVSS score for this vulnerability is 5.9, indicating a moderate level of severity.
If you cannot update TensorFlow immediately, ensure that you validate the input to the SetSize function to be a 1D tensor to mitigate the risk of exploitation.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow-cpu.