CVE-2021-37638: Null pointer dereference in `RaggedTensorToTensor` in TensorFlow
Impact Sending invalid argument for rowpartitiontypes of tf.rawops.RaggedTensorToTensor API results in a null pointer dereference and undefined behavior:
python import tensorflow as tf
tf.rawops.RaggedTensorToTensor( shape=1, values=10, defaultvalue=21, rowpartitiontensors=tf.constant([0,0,0,0]), rowpartitiontypes=[])
The implementation accesses the first element of a user supplied list of values without validating that the provided list is not empty.
Patches We have patched the issue in GitHub commit 301ae88b331d37a2a16159b65b255f4f9eb39314.
The fix will be included in TensorFlow 2.6.0. We will also cherrypick this commit on TensorFlow 2.5.1, TensorFlow 2.4.3, and TensorFlow 2.3.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 members of the Aivul Team from Qihoo 360.
Other sources
TensorFlow is an end-to-end open source platform for machine learning. Sending invalid argument for rowpartitiontypes of tf.rawops.RaggedTensorToTensor API results in a null pointer dereference and undefined behavior. The implementation accesses the first element of a user supplied list of values without validating that the provided list is not empty. We have patched the issue in GitHub commit 301ae88b331d37a2a16159b65b255f4f9eb39314. The fix will be included in TensorFlow 2.6.0. We will also cherrypick this commit on TensorFlow 2.5.1, TensorFlow 2.4.3, and TensorFlow 2.3.4, as these are also affected and still in supported range.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
pip/tensorflow-gputo a version that resolves this vulnerability.Fixed in 2.5.1 - Upgrade
Upgrade
pip/tensorflow-gputo a version that resolves this vulnerability.Fixed in 2.4.3 - Upgrade
Upgrade
pip/tensorflow-gputo a version that resolves this vulnerability.Fixed in 2.3.4 - Upgrade
Upgrade
pip/tensorflow-cputo a version that resolves this vulnerability.Fixed in 2.5.1 - Upgrade
Upgrade
pip/tensorflow-cputo a version that resolves this vulnerability.Fixed in 2.4.3 - Upgrade
Upgrade
pip/tensorflow-cputo a version that resolves this vulnerability.Fixed in 2.3.4 - Upgrade
Upgrade
pip/tensorflowto a version that resolves this vulnerability.Fixed in 2.5.1 - Upgrade
Upgrade
pip/tensorflowto a version that resolves this vulnerability.Fixed in 2.4.3 - Upgrade
Upgrade
pip/tensorflowto a version that resolves this vulnerability.Fixed in 2.3.4 - Upgrade
Upgrade
tensorflowto a version that resolves this vulnerability.Fixed in 2.6.0Patch GitHub commit 301ae88b331d37a2a16159b65b255f4f9eb39314 - Upgrade
Upgrade
tensorflowto a version that resolves this vulnerability.Fixed in 2.5.1Patch GitHub commit 301ae88b331d37a2a16159b65b255f4f9eb39314 - Upgrade
Upgrade
tensorflowto a version that resolves this vulnerability.Fixed in 2.4.3Patch GitHub commit 301ae88b331d37a2a16159b65b255f4f9eb39314 - Upgrade
Upgrade
tensorflowto a version that resolves this vulnerability.Fixed in 2.3.4Patch GitHub commit 301ae88b331d37a2a16159b65b255f4f9eb39314
Event History
Frequently Asked Questions
What is the severity of CVE-2021-37638?
CVE-2021-37638 has been classified with a severity rating that indicates a risk of null pointer dereference and undefined behavior.
How do I fix CVE-2021-37638?
To fix CVE-2021-37638, upgrade TensorFlow to version 2.5.1 or later.
Which versions of TensorFlow are affected by CVE-2021-37638?
CVE-2021-37638 affects TensorFlow versions 2.5.0, 2.4.0 to 2.4.3, and earlier than 2.3.4.
Is CVE-2021-37638 related to a specific API in TensorFlow?
Yes, CVE-2021-37638 is related to the `tf.raw_ops.RaggedTensorToTensor` API.
What kind of issues does CVE-2021-37638 cause in TensorFlow?
CVE-2021-37638 can cause a null pointer dereference leading to potential crashes and undefined behavior in TensorFlow applications.