CVE-2021-41224: TensorFlow - Heap Out-of-Bounds Access in SparseFillEmptyRows

tensorflow Updated 02 Oct 2025

Summary

06/03/2024
Yes i
High
Not published

CVE-2021-41224: SparseFillEmptyRows heap OOB read. 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-41224 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 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. However, a vulnerability has been identified in TensorFlow that can lead to a heap out-of-bounds access when using the SparseFillEmptyRows implementation.

Vulnerability Detail

The vulnerability occurs when the size of the indices parameter does not match the size of the values parameter in the SparseFillEmptyRows function. This mismatch triggers a heap out-of-bounds access, potentially leading to memory corruption and arbitrary code execution. The issue affects versions of TensorFlow up to 2.6.0. Exploiting this vulnerability could allow an attacker to execute malicious code or cause a denial-of-service condition.

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

There is no known workaround for this vulnerability. It is recommended to apply the provided fix by updating to the latest version of TensorFlow.

Conclusion

The vulnerability in TensorFlow's SparseFillEmptyRows function can lead to a heap out-of-bounds access, potentially resulting in memory corruption and arbitrary code execution. Users are advised to update their TensorFlow installation to the fixed versions or apply the provided fix. 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 that provides tools and libraries for developing and deploying machine learning models.

This vulnerability can lead to a heap out-of-bounds access, potentially resulting in memory corruption and arbitrary code execution. Exploiting this vulnerability could allow an attacker to execute malicious code or cause a denial-of-service condition.

The vulnerability affects TensorFlow versions up to 2.6.0. The fix has been applied in TensorFlow 2.7.0 and backported to TensorFlow 2.6.1, TensorFlow 2.5.2, and TensorFlow 2.4.4.

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

For more information about this vulnerability, you can refer to the official TensorFlow documentation or contact the TensorFlow development team.

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