CVE-2021-37663: Incomplete validation in `QuantizeV2` in TensorFlow
Impact Due to incomplete validation in tf.rawops.QuantizeV2, an attacker can trigger undefined behavior via binding a reference to a null pointer or can access data outside the bounds of heap allocated arrays:
python import tensorflow as tf
tf.rawops.QuantizeV2( input=[1,2,3], minrange=[1,2], maxrange=[], T=tf.qint32, mode='SCALED', roundmode='HALFAWAYFROMZERO', narrowrange=False, axis=1, ensureminimumrange=3)
The implementation has some validation but does not check that minrange and maxrange both have the same non-zero number of elements. If axis is provided (i.e., not -1), then validation should check that it is a value in range for the rank of input tensor and then the lengths of minrange and maxrange inputs match the axis dimension of the input tensor. Patches We have patched the issue in GitHub commit 6da6620efad397c85493b8f8667b821403516708. 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 due to incomplete validation in tf.rawops.QuantizeV2, an attacker can trigger undefined behavior via binding a reference to a null pointer or can access data outside the bounds of heap allocated arrays. The implementation has some validation but does not check that minrange and maxrange both have the same non-zero number of elements. If axis is provided (i.e., not -1), then validation should check that it is a value in range for the rank of input tensor and then the lengths of minrange and maxrange inputs match the axis dimension of the input tensor. We have patched the issue in GitHub commit 6da6620efad397c85493b8f8667b821403516708. 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 6da6620efad397c85493b8f8667b821403516708 - Upgrade
Upgrade
TensorFlowto a version that resolves this vulnerability.Fixed in 2.5.1Patch 6da6620efad397c85493b8f8667b821403516708 - Upgrade
Upgrade
TensorFlowto a version that resolves this vulnerability.Fixed in 2.4.3Patch 6da6620efad397c85493b8f8667b821403516708 - Upgrade
Upgrade
TensorFlowto a version that resolves this vulnerability.Fixed in 2.3.4Patch 6da6620efad397c85493b8f8667b821403516708
Event History
Frequently Asked Questions
What is the severity of CVE-2021-37663?
CVE-2021-37663 has a medium severity rating as it could lead to information disclosure in certain scenarios.
How do I fix CVE-2021-37663?
To mitigate CVE-2021-37663, upgrade to TensorFlow version 2.5.1 or later.
Which versions are affected by CVE-2021-37663?
CVE-2021-37663 affects TensorFlow versions from 2.3.0 up to 2.6.0-rc2.
Is CVE-2021-37663 a remote execution vulnerability?
No, CVE-2021-37663 is not a remote execution vulnerability, it is primarily an information disclosure vulnerability.
Are there any known exploits for CVE-2021-37663?
As of now, there are no publicly known exploits specifically targeting CVE-2021-37663.