CVE-2022-35993: TensorFlow Denial of Service Vulnerability in SetSize Function

tensorflow Updated 18 Jul 2026

Summary

13/07/2026
Yes i
Moderate
5.9

CVE-2022-35993: TensorFlow vulnerable to CHECK fail in SetSize. 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

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.

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

TensorFlow is an open-source machine learning library developed by Google. It is widely used for building and training machine learning models. TensorFlow provides a flexible architecture that allows users to deploy computation across various platforms, including CPUs, GPUs, and TPUs. The library is designed to facilitate the development of deep learning applications, but it is not without its vulnerabilities. One such vulnerability is found in the SetSize function, which can lead to denial of service attacks if not properly handled.

Vulnerability Detail

The vulnerability arises when the SetSize function receives an input set_shape that is not a 1D tensor. This situation triggers a CHECK failure, which can be exploited to cause a denial of service. An attacker can craft inputs that lead to this failure, effectively crashing the application or making it unresponsive. The technical details indicate that the vulnerability is present in TensorFlow versions prior to 2.7.2, 2.8.1, and 2.9.1, making it critical for users of these versions to take action.

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.2 2.7.2
    pip install --upgrade "tensorflow==2.7.2"
  • >= 2.8.0, < 2.8.1 2.8.1
    pip install --upgrade "tensorflow==2.8.1"
  • >= 2.9.0, < 2.9.1 2.9.1
    pip 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

Currently, there are no specific workarounds provided for this vulnerability. The best course of action is to update to the patched versions mentioned above. However, if immediate updating is not possible, avoid using the SetSize function with non-1D tensor inputs to mitigate the risk temporarily.

Conclusion

In summary, CVE-2022-35993 is a significant vulnerability in TensorFlow that can lead to denial of service attacks. Users are strongly advised to update to the patched versions to ensure their applications remain secure. Utilizing tools like Vulert can help monitor and alert for such vulnerabilities in real-time.

See every vulnerability recorded for tensorflow →

Share this vulnerability

FAQ

CVE-2022-35993 is a vulnerability in TensorFlow that can lead to denial of service when the SetSize function is used with incorrect input shapes.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

TensorFlow versions prior to 2.7.2, 2.8.1, and 2.9.1 are affected by this vulnerability.

The CVSS score of this vulnerability is 5.9, indicating a moderate severity level.

If you cannot update immediately, avoid using the SetSize function with non-1D tensor inputs to reduce the risk of exploitation.

Related vulnerabilities

Recent vulnerabilities recorded for tensorflow.

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.2 2.7.2
    pip install --upgrade "tensorflow==2.7.2"
  • >= 2.8.0, < 2.8.1 2.8.1
    pip install --upgrade "tensorflow==2.8.1"
  • >= 2.9.0, < 2.9.1 2.9.1
    pip 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 →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback