CVE-2021-41226: TensorFlow - Heap Out-of-Bounds Access in SparseBinCount

tensorflow Updated 02 Oct 2025

Summary

06/03/2024
Yes i
High
Not published

CVE-2021-41226: Heap OOB read in SparseBinCount. 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-41226 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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

TensorFlow is an open source platform for machine learning. It provides a comprehensive ecosystem of tools, libraries, and resources for building and deploying machine learning models. TensorFlow is widely used in various domains, including research, industry, and academia. However, a vulnerability has been identified in TensorFlow that affects certain versions of the package.

Vulnerability Detail

The vulnerability, identified as CVE-2021-41226, is related to the implementation of SparseBinCount in TensorFlow. It arises due to the absence of proper validation between the elements of the values argument and the shape of the sparse output. This flaw can lead to a heap out-of-bounds access, potentially resulting in a variety of security issues, such as information disclosure or remote code execution. The vulnerability has been assigned a severity rating of High.

How To Fix

Fixed versions by release line

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

  • < 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 provided for this vulnerability. The recommended course of action is to apply the available patches or update to the fixed versions of TensorFlow.

Conclusion

In conclusion, TensorFlow is susceptible to a heap out-of-bounds access vulnerability in the SparseBinCount implementation. This vulnerability can have serious security implications and should be addressed by updating to the fixed versions of TensorFlow. For further assistance or support 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 building and deploying machine learning models.

The vulnerability can lead to a heap out-of-bounds access, which may result in security issues such as information disclosure or remote code execution.

The vulnerability affects TensorFlow versions 2.4.4, 2.5.2, 2.6.1, and any earlier versions within the supported range.

To fix this vulnerability, update your TensorFlow installation to one of the fixed versions: TensorFlow 2.7.0, TensorFlow 2.6.1, TensorFlow 2.5.2, or TensorFlow 2.4.4.

No specific workaround has been provided. It is recommended to apply the available patches or update to the fixed versions of TensorFlow.

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.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