CVE-2021-41201: Unitialized access in `EinsumHelper::ParseEquation`
Impact During execution, EinsumHelper::ParseEquation() is supposed to set the flags in inputhasellipsis vector and outputhasellipsis boolean to indicate whether there is ellipsis in the corresponding inputs and output.
However, the code only changes these flags to true and never assigns false.
cc for (int i = 0; i < numinputs; ++i) { inputlabelcounts->at(i).resize(numlabels); for (const int label : inputlabels->at(i)) { if (label != kEllipsisLabel) inputlabelcounts->at(i)[label] += 1; else inputhasellipsis->at(i) = true; } } outputlabelcounts->resize(numlabels); for (const int label : outputlabels) { if (label != kEllipsisLabel) outputlabelcounts->at(label) += 1; else outputhasellipsis = true; }
This results in unitialized variable access if callers assume that EinsumHelper::ParseEquation() always sets these flags.
Patches We have patched the issue in GitHub commit f09caa532b6e1ac8d2aa61b7832c78c5b79300c6.
The fix will be included in TensorFlow 2.7.0. We will also cherrypick this commit on TensorFlow 2.6.1, TensorFlow 2.5.2, and TensorFlow 2.4.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.
Other sources
TensorFlow is an open source platform for machine learning. In affeced versions during execution, EinsumHelper::ParseEquation() is supposed to set the flags in inputhasellipsis vector and outputhasellipsis boolean to indicate whether there is ellipsis in the corresponding inputs and output. However, the code only changes these flags to true and never assigns false. This results in unitialized variable access if callers assume that EinsumHelper::ParseEquation() always sets these flags. The fix will be included in TensorFlow 2.7.0. We will also cherrypick this commit on TensorFlow 2.6.1, TensorFlow 2.5.2, and TensorFlow 2.4.4, as these are also affected and still in supported range.
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2021-41201?
CVE-2021-41201 has a severity level classified as medium, indicating a moderate impact on affected systems.
How do I fix CVE-2021-41201?
To fix CVE-2021-41201, upgrade TensorFlow to versions 2.4.4, 2.5.2 or 2.6.1 accordingly based on your current version.
Which versions of TensorFlow are affected by CVE-2021-41201?
CVE-2021-41201 affects TensorFlow versions prior to 2.4.4, versions 2.5.0 up to under 2.5.2, and exactly version 2.6.0.
What is the nature of the vulnerability in CVE-2021-41201?
The vulnerability in CVE-2021-41201 involves improper handling of input parameters in the EinsumHelper's ParseEquation function.
Can CVE-2021-41201 lead to a system compromise?
CVE-2021-41201 could potentially lead to unexpected behavior or crashes, but it does not directly enable remote code execution or full system compromise.