CVE-2021-41201: Uninitialized access in EinsumHelper::ParseEquation in TensorFlow

tensorflow Updated 02 Oct 2025

Summary

10/11/2021
Yes i
High
7.8

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

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.

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

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.4 2.4.4
    pip install --upgrade "tensorflow==2.4.4"
  • >= 2.5.0, < 2.5.2 2.5.2
    pip install --upgrade "tensorflow==2.5.2"
  • >= 2.6.0, < 2.6.1 2.6.1
    pip 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 →

Share this vulnerability

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

Related vulnerabilities

Recent vulnerabilities recorded for tensorflow.

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.4 2.4.4
    pip install --upgrade "tensorflow==2.4.4"
  • >= 2.5.0, < 2.5.2 2.5.2
    pip install --upgrade "tensorflow==2.5.2"
  • >= 2.6.0, < 2.6.1 2.6.1
    pip 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 →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback