CVE-2021-29577: Heap buffer overflow in `AvgPool3DGrad`
Impact The implementation of tf.rawops.AvgPool3DGrad is vulnerable to a heap buffer overflow:
python import tensorflow as tf
originputshape = tf.constant([10, 6, 3, 7, 7], shape=[5], dtype=tf.int32) grad = tf.constant([0.01, 0, 0], shape=[3, 1, 1, 1, 1], dtype=tf.float32) ksize = [1, 1, 1, 1, 1] strides = [1, 1, 1, 1, 1] padding = "SAME"
tf.rawops.AvgPool3DGrad( originputshape=originputshape, grad=grad, ksize=ksize, strides=strides, padding=padding)
The implementation assumes that the originputshape and grad tensors have similar first and last dimensions but does not check that this assumption is validated.
Patches We have patched the issue in GitHub commit 6fc9141f42f6a72180ecd24021c3e6b36165fe0d.
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.AvgPool3DGrad is vulnerable to a heap buffer overflow. The implementation(https://github.com/tensorflow/tensorflow/blob/d80ffba9702dc19d1fac74fc4b766b3fa1ee976b/tensorflow/core/kernels/poolingops3d.cc#L376-L450) assumes that the originputshape and grad tensors have similar first and last dimensions but does not check that this assumption is validated. 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
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2021-29577?
CVE-2021-29577 has been classified with high severity due to the potential for heap buffer overflow exploitation.
What software is affected by CVE-2021-29577?
CVE-2021-29577 affects multiple versions of Google TensorFlow up to and including version 2.4.1.
How do I fix CVE-2021-29577?
To mitigate CVE-2021-29577, upgrade TensorFlow to version 2.4.2 or later.
What type of vulnerability is CVE-2021-29577?
CVE-2021-29577 is a heap buffer overflow vulnerability that can lead to memory corruption.
Can CVE-2021-29577 be exploited remotely?
Yes, CVE-2021-29577 can be exploited remotely if the vulnerable TensorFlow application is exposed to untrusted data.