CVE-2021-41220: TensorFlow Memory Leak and Use After Free Vulnerability

tensorflow Updated 02 Oct 2025

Summary

06/03/2024
Yes i
High
Not published

CVE-2021-41220: Use after free in CollectiveReduceV2. Affects tensorflow versions >= 2.6.0, < 2.6.1. Fixed in 2.6.1. How to fix ↓

Also tracked for

The same CVE-2021-41220 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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

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 industries and research domains for tasks such as image recognition, natural language processing, and recommendation systems. However, the async implementation of CollectiveReduceV2 in TensorFlow is vulnerable to a memory leak and a use after free issue.

Vulnerability Detail

The memory leak and use after free vulnerability in TensorFlow's async implementation of CollectiveReduceV2 is caused by the asynchronous computation and the access of objects that have been std::move()d from. This can lead to memory exhaustion and potential exploitation by an attacker. The vulnerability affects versions 2.6.0 and 2.7.0-rc0/2.7.0-rc1 of TensorFlow. The impact of this vulnerability can range from denial of service to remote code execution.

How To Fix

Minimum fixed version

2.6.1

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no known workaround for this vulnerability. It is recommended to update to the fixed versions of TensorFlow as soon as possible.

Conclusion

The memory leak and use after free vulnerability in TensorFlow's async implementation of CollectiveReduceV2 can have serious security implications. It is crucial to update to the fixed versions of TensorFlow to mitigate the risk. For further support on vulnerability remediation, you can reach out to DevNack.com.

See every vulnerability recorded for tensorflow →

Share this vulnerability

FAQ

TensorFlow is an open source platform for machine learning, widely used for developing and deploying machine learning models.

The impact of this vulnerability can range from denial of service to remote code execution.

Versions 2.6.0, 2.7.0-rc0, and 2.7.0-rc1 of TensorFlow are affected.

To fix this vulnerability, update to TensorFlow version 2.6.1 or higher.

There is no known workaround for this vulnerability. It is recommended to update to the fixed versions of TensorFlow.

Related vulnerabilities

Recent vulnerabilities recorded for tensorflow.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

2.6.1

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. 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