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

tensorflow Updated 02 Oct 2025

Summary

06/03/2024
Yes i
Medium
Not published

CVE-2021-29575: Overflow/denial of service in tf.raw_ops.ReverseSequence. Affects tensorflow across 4 version ranges.

< 2.1.5 >= 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-29575 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 research domains.

Vulnerability Detail

The vulnerability identified as CVE-2021-29575 affects the implementation of tf.raw_ops.ReverseSequence in TensorFlow. This vulnerability allows for a stack overflow or denial of service (DoS) attack. The issue arises due to the lack of validation for the seq_dim and batch_dim arguments. Negative values for seq_dim can lead to stack overflow or CHECK-failure, depending on the version of Eigen code used. Similarly, invalid values for batch_dim can also trigger the same behavior. The impact of this vulnerability can result in the disruption 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.1.5 2.1.5
  • >= 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

As a temporary workaround, users can avoid passing negative or invalid values for seq_dim and batch_dim when using the tf.raw_ops.ReverseSequence operation. Ensuring that only valid and positive values are provided as arguments can help prevent the exploitation of this vulnerability.

Conclusion

The vulnerability identified as CVE-2021-29575 in TensorFlow can lead to a denial of service (DoS) attack or stack overflow. It is crucial to update to the latest patched version of TensorFlow to mitigate the risk associated with this vulnerability. For further support and assistance in vulnerability remediation, please 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 lead to a denial of service (DoS) attack or stack overflow, potentially disrupting TensorFlow-based applications and services.

The vulnerability affects TensorFlow versions 0 and 2.1.4 to 2.4.2. It is recommended to update to the latest patched version to mitigate the risk.

To fix this vulnerability, update TensorFlow to the latest patched version, which includes the necessary fixes.

As a temporary workaround, ensure that only valid and positive values are passed as arguments for seq_dim and batch_dim in the tf.raw_ops.ReverseSequence operation.

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.5 2.1.5
  • >= 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