CVE-2021-41210: TensorFlow - Out-of-Bounds Read in SparseCountSparseOutput Shape Inference Functions

tensorflow Updated 02 Oct 2025

Summary

06/03/2024
Yes i
High
Not published

CVE-2021-41210: Heap OOB read in tf.raw_ops.SparseCountSparseOutput. 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-41210 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 allows users to build and train neural networks, perform data preprocessing and augmentation, and deploy models in various environments. It is widely used in both research and production settings.

Vulnerability Detail

The vulnerability identified as CVE-2021-41210 affects TensorFlow versions 2.4.4, 2.5.2, and 2.6.0. It resides in the shape inference functions for SparseCountSparseOutput, which can trigger a read outside the bounds of a heap-allocated array. This out-of-bounds read can lead to memory corruption and potentially allow an attacker to execute arbitrary code or cause a denial-of-service condition. The severity of this vulnerability is rated as 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

There is no specific workaround provided for this vulnerability. It is recommended to apply the available patches or update to the fixed versions of TensorFlow as mentioned in the 'how_to_fix' section.

Conclusion

The vulnerability in TensorFlow's shape inference functions for SparseCountSparseOutput can lead to memory corruption and potential code execution or denial-of-service. It is crucial to update TensorFlow to the fixed versions or apply the available patches to mitigate this vulnerability. For further support on vulnerability remediation, 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 libraries for building and deploying machine learning models.

This vulnerability can lead to memory corruption and potentially allow an attacker to execute arbitrary code or cause a denial-of-service condition.

The vulnerability affects TensorFlow versions 2.4.4, 2.5.2, and 2.6.0.

To fix this vulnerability, update TensorFlow to version 2.7.0 or apply the available patches for versions 2.6.1, 2.5.2, and 2.4.4.

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

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