CVE-2021-37642: Division by 0 in `ResourceScatterDiv` in TensorFlow
Impact The implementation of tf.rawops.ResourceScatterDiv is vulnerable to a division by 0 error:
python import tensorflow as tf
v= tf.Variable([1,2,3]) tf.rawops.ResourceScatterDiv( resource=v.handle, indices=[1], updates=[0])
The implementation uses a common class for all binary operations but fails to treat the division by 0 case separately.
Patches We have patched the issue in GitHub commit 4aacb30888638da75023e6601149415b39763d76.
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 the implementation of tf.rawops.ResourceScatterDiv is vulnerable to a division by 0 error. The implementation uses a common class for all binary operations but fails to treat the division by 0 case separately. We have patched the issue in GitHub commit 4aacb30888638da75023e6601149415b39763d76. 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.0 - Upgrade
Upgrade
tensorflowto a version that resolves this vulnerability.Patch 4aacb30888638da75023e6601149415b39763d76 - Upgrade
Upgrade
tensorflowto a version that resolves this vulnerability.Fixed in 2.5.1Patch 4aacb30888638da75023e6601149415b39763d76 - Upgrade
Upgrade
tensorflowto a version that resolves this vulnerability.Fixed in 2.4.3Patch 4aacb30888638da75023e6601149415b39763d76 - Upgrade
Upgrade
tensorflowto a version that resolves this vulnerability.Fixed in 2.3.4Patch 4aacb30888638da75023e6601149415b39763d76
Event History
Frequently Asked Questions
What is the severity of CVE-2021-37642?
CVE-2021-37642 has a medium severity due to the potential for a division by zero error.
How do I fix CVE-2021-37642?
To fix CVE-2021-37642, upgrade TensorFlow to version 2.5.1 or later.
Which versions of TensorFlow are affected by CVE-2021-37642?
CVE-2021-37642 affects TensorFlow versions 2.3.0 up to 2.3.4, 2.4.0 up to 2.4.3, and specific release candidates of 2.6.0.
What is the impact of CVE-2021-37642?
The impact of CVE-2021-37642 includes application crashes or unexpected behavior due to division by zero errors.
Is CVE-2021-37642 exploit-related?
CVE-2021-37642 may be exploited if unhandled by the developer, leading to application instability.