CVE-2021-37668: Division by zero in TensorFlow Lite `tf.raw_ops.UnravelIndex`
Impact An attacker can cause denial of service in applications serving models using tf.rawops.UnravelIndex by triggering a division by 0:
python import tensorflow as tf
tf.rawops.UnravelIndex(indices=-1, dims=[1,0,2]) The implementation does not check that the tensor subsumed by dims is not empty. Hence, if one element of dims is 0, the implementation does a division by 0.
Patches We have patched the issue in GitHub commit a776040a5e7ebf76eeb7eb923bf1ae417dd4d233.
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. In affected versions an attacker can cause denial of service in applications serving models using tf.rawops.UnravelIndex by triggering a division by 0. The implementation does not check that the tensor subsumed by dims is not empty. Hence, if one element of dims is 0, the implementation does a division by 0. We have patched the issue in GitHub commit a776040a5e7ebf76eeb7eb923bf1ae417dd4d233. 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 a776040a5e7ebf76eeb7eb923bf1ae417dd4d233 - Upgrade
Upgrade
TensorFlowto a version that resolves this vulnerability.Fixed in 2.5.1Patch a776040a5e7ebf76eeb7eb923bf1ae417dd4d233 - Upgrade
Upgrade
TensorFlowto a version that resolves this vulnerability.Fixed in 2.4.3Patch a776040a5e7ebf76eeb7eb923bf1ae417dd4d233 - Upgrade
Upgrade
TensorFlowto a version that resolves this vulnerability.Fixed in 2.3.4Patch a776040a5e7ebf76eeb7eb923bf1ae417dd4d233
Event History
Frequently Asked Questions
What is the severity of CVE-2021-37668?
CVE-2021-37668 has been classified as a denial of service vulnerability due to a division by zero error in TensorFlow.
How do I fix CVE-2021-37668?
To fix CVE-2021-37668, upgrade TensorFlow to version 2.5.1 or later for CPU and GPU packages.
Which versions of TensorFlow are affected by CVE-2021-37668?
CVE-2021-37668 affects TensorFlow versions 2.3.0 to 2.3.4, 2.4.0 to 2.4.3, and specific release candidates of 2.6.0.
What can an attacker do with CVE-2021-37668?
An attacker can exploit CVE-2021-37668 to cause a denial of service in applications that serve models using the affected TensorFlow function.
Is CVE-2021-37668 specific to any operating system?
CVE-2021-37668 is not specific to any operating system as it affects the TensorFlow library across various platforms.