CVE-2021-29552: TensorFlow - Denial of Service Vulnerability

tensorflow Updated 02 Oct 2025

Summary

06/03/2024
Yes i
Medium
Not published

CVE-2021-29552: CHECK-failure in UnsortedSegmentJoin. Affects tensorflow across 4 version ranges.

< 2.1.4 >= 2.2.0, < 2.2.3 >= 2.3.0, < 2.3.3 >= 2.4.0, < 2.4.2

Fixed in 4 releases; the minimum fixed version depends on the release line you run. How to fix ↓

Also tracked for

The same CVE-2021-29552 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 end-to-end open source platform for machine learning. It provides a comprehensive ecosystem of tools, libraries, and resources for developing and deploying machine learning models. TensorFlow is widely used in various industries and applications, including image recognition, natural language processing, and recommendation systems. However, a vulnerability has been discovered in TensorFlow that can lead to a denial of service attack.

Vulnerability Detail

The vulnerability in TensorFlow is caused by a flaw in the UnsortedSegmentJoin function. An attacker can exploit this vulnerability by controlling the values of the num_segments tensor argument. The implementation assumes that the num_segments tensor is a valid scalar, but if the tensor is empty, the validation check fails and the process terminates, resulting in a denial of service. This vulnerability can be exploited remotely by an attacker with the ability to control the input values of the num_segments tensor.

How To Fix

Fixed versions by release line

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

  • < 2.1.4 2.1.4
  • >= 2.2.0, < 2.2.3 2.2.3
  • >= 2.3.0, < 2.3.3 2.3.3
  • >= 2.4.0, < 2.4.2 2.4.2

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

Workaround

There is no specific workaround mentioned for this vulnerability.

Conclusion

The vulnerability in TensorFlow can lead to a denial of service attack if exploited by an attacker. It is important to upgrade to the latest version of TensorFlow or apply the provided patches to mitigate this vulnerability. Regularly updating your TensorFlow installation and following best practices for secure machine learning model deployment are also recommended. For further support on vulnerability remediation, you can contact DevNack.com.

See every vulnerability recorded for tensorflow →

Share this vulnerability

FAQ

TensorFlow is an open source platform for machine learning that provides tools and resources for developing and deploying machine learning models.

This vulnerability can be exploited by an attacker to cause a denial of service, potentially disrupting the availability of TensorFlow-based applications.

Yes, this vulnerability can be exploited remotely by an attacker with the ability to control the input values of the num_segments tensor.

The recommended mitigation is to upgrade to the latest version of TensorFlow once the fix is available. In the meantime, you can apply the provided patches for the affected versions.

You can find more information about this vulnerability in the official TensorFlow documentation and the vulnerability database.

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.1.4 2.1.4
  • >= 2.2.0, < 2.2.3 2.2.3
  • >= 2.3.0, < 2.3.3 2.3.3
  • >= 2.4.0, < 2.4.2 2.4.2

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