CVE-2021-37691: Division by zero in LSH in TensorFlow Lite
Impact An attacker can craft a TFLite model that would trigger a division by zero error in LSH implementation.
cc int RunningSignBit(const TfLiteTensor input, const TfLiteTensor weight, float seed) { int inputitembytes = input->bytes / SizeOfDimension(input, 0); // ... } There is no check that the first dimension of the input is non zero. Patches We have patched the issue in GitHub commit 0575b640091680cfb70f4dd93e70658de43b94f9.
The fix will be included in TensorFlow 2.6.0. We will also cherrypick thiscommit 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 Yakun Zhang of Baidu Security.
Other sources
TensorFlow is an end-to-end open source platform for machine learning. In affected versions an attacker can craft a TFLite model that would trigger a division by zero error in LSH implementation. We have patched the issue in GitHub commit 0575b640091680cfb70f4dd93e70658de43b94f9. The fix will be included in TensorFlow 2.6.0. We will also cherrypick thiscommit 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 Lite (LSH division by zero in lsh_projection.cc)to a version that resolves this vulnerability.Fixed in 2.6.0Patch 0575b640091680cfb70f4dd93e70658de43b94f9 - Upgrade
Upgrade
TensorFlow (TensorFlow Lite LSH)to a version that resolves this vulnerability.Fixed in 2.5.1Patch 0575b640091680cfb70f4dd93e70658de43b94f9 - Upgrade
Upgrade
TensorFlow (TensorFlow Lite LSH)to a version that resolves this vulnerability.Fixed in 2.4.3Patch 0575b640091680cfb70f4dd93e70658de43b94f9 - Upgrade
Upgrade
TensorFlow (TensorFlow Lite LSH)to a version that resolves this vulnerability.Fixed in 2.3.4Patch 0575b640091680cfb70f4dd93e70658de43b94f9
Event History
Frequently Asked Questions
What is the severity of CVE-2021-37691?
CVE-2021-37691 is considered a high severity vulnerability due to potential denial-of-service conditions.
How do I fix CVE-2021-37691?
To fix CVE-2021-37691, you should update your Google TensorFlow installation to version 2.5.1 or later.
Which versions of TensorFlow are affected by CVE-2021-37691?
CVE-2021-37691 affects TensorFlow versions 2.3.0 to 2.3.4, 2.4.0 to 2.4.3, and 2.5.0.
What type of attack can exploit CVE-2021-37691?
An attacker can exploit CVE-2021-37691 by crafting a TFLite model that triggers a division by zero error.
Is CVE-2021-37691 relevant for TensorFlow Lite users?
Yes, CVE-2021-37691 is particularly relevant for TensorFlow Lite users due to its impact on model execution.