CVE-2021-41227: TensorFlow - Arbitrary Memory Read Vulnerability

tensorflow Updated 02 Oct 2025

Summary

06/03/2024
Yes i
Medium
Not published

CVE-2021-41227: Arbitrary memory read in ImmutableConst. Affects tensorflow across 3 version ranges.

>= 2.4.0, < 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-41227 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 Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

TensorFlow is an open source platform for machine learning. It provides a comprehensive ecosystem of tools, libraries, and resources for developing and deploying machine learning models. TensorFlow is widely used in various domains, including research, industry, and academia. It offers support for various programming languages and platforms, making it accessible and versatile for developers. However, a vulnerability has been identified in TensorFlow that allows for arbitrary memory read, potentially leading to unauthorized access and information disclosure.

Vulnerability Detail

The vulnerability, identified as CVE-2021-41227, resides in the ImmutableConst operation of TensorFlow. It arises from a special case handling of memory mapped strings in the tstring TensorFlow string class, without proper support in the operation itself. This flaw can be exploited to trick the ImmutableConst operation into reading arbitrary memory contents. An attacker could leverage this vulnerability to access sensitive information, such as cryptographic keys, authentication tokens, or other confidential data stored in memory. The impact of this vulnerability can be significant, potentially leading to unauthorized access, data leakage, and further exploitation of the compromised system.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • >= 2.4.0, < 2.4.4 2.4.4
  • >= 2.5.0, < 2.5.2 2.5.2
  • >= 2.6.0, < 2.6.1 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 specific workaround has been mentioned for this vulnerability. However, users can consider implementing general security best practices to minimize the risk of exploitation. These practices may include restricting access to vulnerable systems, implementing strong access controls, regularly monitoring and auditing system activity, and applying security patches and updates promptly. It is recommended to consult the official TensorFlow documentation and security resources for additional guidance on securing TensorFlow installations.

Conclusion

The vulnerability in TensorFlow, identified as CVE-2021-41227, poses a risk of arbitrary memory read and unauthorized access. It is crucial for users to update their TensorFlow installations to the latest patched version as soon as it becomes available. By staying up to date with security patches and following best practices, users can ensure the integrity and security of their machine learning workflows and applications. For further support and assistance in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for tensorflow →

Share this vulnerability

FAQ

TensorFlow is an open source platform for machine learning that provides tools and resources for developing and deploying machine learning models.

The vulnerability allows for arbitrary memory read in TensorFlow, potentially leading to unauthorized access and information disclosure. It can be exploited to access sensitive data stored in memory.

The vulnerability affects TensorFlow versions 2.4.0 to 2.4.4, 2.5.0 to 2.5.2, 2.6.0 to 2.6.1, and 2.7.0-rc0 to 2.7.0-rc1.

Yes, the TensorFlow development team has addressed the vulnerability in TensorFlow 2.7.0 and backported the fix to earlier versions within the supported range.

To protect your TensorFlow installation, it is recommended to update to the latest patched version as soon as it becomes available. Follow the official upgrade instructions provided by TensorFlow and implement general security best practices.

Related vulnerabilities

Recent vulnerabilities recorded for tensorflow.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • >= 2.4.0, < 2.4.4 2.4.4
  • >= 2.5.0, < 2.5.2 2.5.2
  • >= 2.6.0, < 2.6.1 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