CVE-2021-37637: Null pointer dereference in `CompressElement` in TensorFlow
Impact It is possible to trigger a null pointer dereference in TensorFlow by passing an invalid input to tf.rawops.CompressElement:
python import tensorflow as tf
tf.rawops.CompressElement(components=[[]]) The implementation was accessing the size of a buffer obtained from the return of a separate function call before validating that said buffer is valid.
Patches We have patched the issue in GitHub commit 5dc7f6981fdaf74c8c5be41f393df705841fb7c5.
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. Concurrently, it was resolved in master branch as it was also discovered internally and fixed before the report was handled.
Other sources
TensorFlow is an end-to-end open source platform for machine learning. It is possible to trigger a null pointer dereference in TensorFlow by passing an invalid input to tf.rawops.CompressElement. The implementation was accessing the size of a buffer obtained from the return of a separate function call before validating that said buffer is valid. We have patched the issue in GitHub commit 5dc7f6981fdaf74c8c5be41f393df705841fb7c5. 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
tensorflow/tensorflowto a version that resolves this vulnerability.Patch 5dc7f6981fdaf74c8c5be41f393df705841fb7c5 - Upgrade
Upgrade
tensorflow/tensorflowto a version that resolves this vulnerability.Fixed in 2.6.0Patch 5dc7f6981fdaf74c8c5be41f393df705841fb7c5 - Upgrade
Upgrade
tensorflow/tensorflowto a version that resolves this vulnerability.Fixed in 2.5.1Patch 5dc7f6981fdaf74c8c5be41f393df705841fb7c5 - Upgrade
Upgrade
tensorflow/tensorflowto a version that resolves this vulnerability.Fixed in 2.4.3Patch 5dc7f6981fdaf74c8c5be41f393df705841fb7c5 - Upgrade
Upgrade
tensorflow/tensorflowto a version that resolves this vulnerability.Fixed in 2.3.4Patch 5dc7f6981fdaf74c8c5be41f393df705841fb7c5
Event History
Frequently Asked Questions
What is the severity of CVE-2021-37637?
CVE-2021-37637 has a severity rating that can lead to a denial of service due to null pointer dereference in TensorFlow.
How do I fix CVE-2021-37637?
To fix CVE-2021-37637, upgrade TensorFlow to version 2.5.1 or later.
Which versions of TensorFlow are affected by CVE-2021-37637?
CVE-2021-37637 affects TensorFlow versions from 2.3.0 to 2.6.0-rc2.
What are the potential impacts of CVE-2021-37637?
The potential impact of CVE-2021-37637 includes application crashes and service unavailability.
Is CVE-2021-37637 specific to TensorFlow GPU or CPU?
CVE-2021-37637 affects both TensorFlow GPU and CPU packages.