CVE-2021-29575: Overflow/denial of service in `tf.raw_ops.ReverseSequence`

Published May 14, 2021
·
Updated

Impact The implementation of tf.rawops.ReverseSequence allows for stack overflow and/or CHECK-fail based denial of service.

python import tensorflow as tf

input = tf.zeros([1, 1, 1], dtype=tf.int32) seqlengths = tf.constant([0], shape=[1], dtype=tf.int32)

tf.rawops.ReverseSequence( input=input, seqlengths=seqlengths, seqdim=-2, batchdim=0)

The implementation fails to validate that seqdim and batchdim arguments are valid. Negative values for seqdim can result in stack overflow or CHECK-failure, depending on the version of Eigen code used to implement the operation. Similar behavior can be exhibited by invalid values of batchdim. Patches We have patched the issue in GitHub commit ecf768cbe50cedc0a45ce1ee223146a3d3d26d23.

The fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2, TensorFlow 2.3.3, TensorFlow 2.2.3 and TensorFlow 2.1.4, as these are also affected and still in supported range.

For more information Please consult our security guide for more information regarding the security model and how to contact us with issues and questions.

Attribution This vulnerability has been reported by Ying Wang and Yakun Zhang of Baidu X-Team.

Other sources

TensorFlow is an end-to-end open source platform for machine learning. The implementation of tf.rawops.ReverseSequence allows for stack overflow and/or CHECK-fail based denial of service. The implementation(https://github.com/tensorflow/tensorflow/blob/5b3b071975e01f0d250c928b2a8f901cd53b90a7/tensorflow/core/kernels/reversesequenceop.cc#L114-L118) fails to validate that seqdim and batchdim arguments are valid. Negative values for seqdim can result in stack overflow or CHECK-failure, depending on the version of Eigen code used to implement the operation. Similar behavior can be exhibited by invalid values of batchdim. The fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2, TensorFlow 2.3.3, TensorFlow 2.2.3 and TensorFlow 2.1.4, as these are also affected and still in supported range.

Affected Software

16 affected componentsFixes available
pip/tensorflow-gpu>=2.4.0<2.4.2
2.4.2
pip/tensorflow-gpu>=2.3.0<2.3.3
2.3.3
pip/tensorflow-gpu>=2.2.0<2.2.3
2.2.3
pip/tensorflow-gpu<2.1.4
2.1.4
pip/tensorflow-cpu>=2.4.0<2.4.2
2.4.2
pip/tensorflow-cpu>=2.3.0<2.3.3
2.3.3
pip/tensorflow-cpu>=2.2.0<2.2.3
2.2.3
pip/tensorflow-cpu<2.1.4
2.1.4
pip/tensorflow>=2.4.0<2.4.2
2.4.2
pip/tensorflow>=2.3.0<2.3.3
2.3.3
pip/tensorflow>=2.2.0<2.2.3
2.2.3
pip/tensorflow<2.1.4
2.1.4
Google TensorFlow<=2.1.4
Google TensorFlow>=2.2.0<2.2.3
Google TensorFlow>=2.3.0<2.3.3
Google TensorFlow>=2.4.0<2.4.2

Event History

May 14, 2021
CVE Published
via MITRE·07:16 PM
Data Sourced
via MITRE·07:16 PM
DescriptionSeverityWeakness
May 21, 2021
Advisory Published
via GitHub·02:26 PM

Frequently Asked Questions

1

What is the severity of CVE-2021-29575?

CVE-2021-29575 has been identified as a denial of service vulnerability.

2

How do I fix CVE-2021-29575?

To fix CVE-2021-29575, upgrade Google TensorFlow to version 2.4.2 or higher.

3

What versions of Google TensorFlow are affected by CVE-2021-29575?

CVE-2021-29575 affects Google TensorFlow versions prior to 2.4.2, including 2.1.4, 2.2.0 through 2.2.3, 2.3.0 through 2.3.3.

4

Does CVE-2021-29575 affect TensorFlow GPU?

Yes, CVE-2021-29575 also impacts TensorFlow GPU versions that fall within the affected range.

5

Is there a workaround for CVE-2021-29575?

There are no known workarounds for CVE-2021-29575; updating TensorFlow is the recommended approach.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203