CVE-2022-21733: TensorFlow - Denial of Service Vulnerability

tensorflow Updated 02 Oct 2025

Summary

06/03/2024
Yes i
Medium
Not published

CVE-2022-21733: Memory exhaustion in Tensorflow. Affects tensorflow across 3 version ranges.

< 2.5.3 >= 2.6.0, < 2.6.3 >= 2.7.0, < 2.7.1

Fixed in 2.5.3, 2.6.3 or 2.7.1, depending on the release line you run. How to fix ↓

Also tracked for

The same CVE-2022-21733 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 framework developed by Google. It provides a comprehensive ecosystem of tools, libraries, and resources for building and deploying machine learning models. TensorFlow is widely used in various domains, including research, industry, and academia. However, a vulnerability has been discovered in TensorFlow that can lead to a denial of service attack.

Vulnerability Detail

The vulnerability (CVE-2022-21733) in TensorFlow arises from an integer overflow in the implementation of the StringNGrams function. This vulnerability can be exploited to trigger an out of memory condition, causing a denial of service. The issue stems from a lack of validation on the pad_width parameter, resulting in the computation of a negative value for ngram_width. This negative value is later used to allocate parts of the output, leading to the out of memory condition. The impact of this vulnerability can be significant, as it can disrupt the availability of TensorFlow-based applications and services.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 2.5.3 2.5.3
  • >= 2.6.0, < 2.6.3 2.6.3
  • >= 2.7.0, < 2.7.1 2.7.1

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

No specific workaround has been mentioned for this vulnerability. The recommended course of action is to apply the available patches or updates to TensorFlow as soon as they are released.

Conclusion

The vulnerability in TensorFlow (CVE-2022-21733) can lead to a denial of service attack by triggering an out of memory condition. It is crucial for users of TensorFlow to update their installations to the latest patched version as soon as it becomes available. This will ensure the security and availability of TensorFlow-based applications and services. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for tensorflow →

Share this vulnerability

FAQ

TensorFlow is an open-source machine learning framework developed by Google. It provides a comprehensive ecosystem of tools, libraries, and resources for building and deploying machine learning models.

The vulnerability in TensorFlow can be exploited to trigger a denial of service attack, causing an out of memory condition and disrupting the availability of TensorFlow-based applications and services.

The vulnerability affects TensorFlow versions 2.5.2, 2.6.0, and 2.7.0. However, the issue has been addressed in TensorFlow 2.5.3, 2.6.2, 2.7.1, and will be fixed in the upcoming TensorFlow 2.8.0 release.

To fix this vulnerability, users should update their TensorFlow installations to the latest patched version as soon as it becomes available. Follow the official upgrade instructions provided by TensorFlow for the specific version you are using.

No specific workaround has been mentioned for this vulnerability. Applying the available patches or updates to TensorFlow is the recommended course of action.

Related vulnerabilities

Recent vulnerabilities recorded for tensorflow.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 2.5.3 2.5.3
  • >= 2.6.0, < 2.6.3 2.6.3
  • >= 2.7.0, < 2.7.1 2.7.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