CVE-2021-41201: Uninitialized access in EinsumHelper::ParseEquation in TensorFlow
Summary
CVE-2021-41201: Unitialized access in EinsumHelper::ParseEquation. Affects tensorflow across 3 version ranges.
< 2.4.4
>= 2.5.0, < 2.5.2
>= 2.6.0, < 2.6.1
Fixed in 2.4.4, 2.5.2 or 2.6.1, depending on the release line you run. How to fix ↓
Also tracked for
- tensorflow · Bitnami
- tensorflow-cpu · PyPI
- tensorflow-gpu · PyPI
The same CVE-2021-41201 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
TensorFlow is an open-source machine learning framework widely used for building and training neural networks. It provides a comprehensive set of tools and libraries for numerical computation and data flow graphs. TensorFlow is available in multiple versions and distributions, including TensorFlow CPU and TensorFlow GPU. This vulnerability affects versions 2.4.4, 2.5.2, 2.6.1, and 2.7.0 of TensorFlow and its CPU and GPU variants.
Vulnerability Detail
The vulnerability, identified as CVE-2021-41201, resides in the EinsumHelper::ParseEquation function of TensorFlow. This function is responsible for setting flags that indicate the presence of ellipsis in input and output tensors. However, the code only sets these flags to true and never assigns them false. As a result, uninitialized variable access occurs when callers assume that the flags are always properly set. This vulnerability has a CVSS score of 7.8, indicating a high severity level.
How To Fix
Latest published version: 2.21.0 as of 22 Oct 2026
pip install --upgrade "tensorflow==2.21.0"
Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.
If you can't move to the latest
The minimum fixed version depends on the release line you run.
-
< 2.4.42.4.4pip install --upgrade "tensorflow==2.4.4" -
>= 2.5.0, < 2.5.22.5.2pip install --upgrade "tensorflow==2.5.2" -
>= 2.6.0, < 2.6.12.6.1pip install --upgrade "tensorflow==2.6.1"
Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →
Workaround
No workaround has been provided for this vulnerability.
Conclusion
In conclusion, CVE-2021-41201 is a high-severity vulnerability in TensorFlow that can result in uninitialized variable access. Users are advised to update their TensorFlow installations to the patched versions mentioned above to mitigate the risk. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for tensorflow →
FAQ
The vulnerability can lead to uninitialized variable access, potentially causing unexpected behavior or crashes in TensorFlow applications.
No, this vulnerability requires an attacker to have local access to the affected TensorFlow installation.
There are no known instances of this vulnerability being exploited in the wild.
While restricting access can reduce the attack surface, it is still recommended to apply the available patches to fully address the vulnerability.
For more information regarding TensorFlow security, please refer to the TensorFlow security guide: https://github.com/tensorflow/tensorflow/blob/master/SECURITY.md
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.