CVE-2021-29570: TensorFlow - Out-of-Bounds Read in MaxPoolGradWithArgmax

tensorflow Updated 02 Oct 2025

Summary

06/03/2024
Yes i
High
Not published

CVE-2021-29570: Heap out of bounds read in MaxPoolGradWithArgmax. Affects tensorflow across 4 version ranges.

< 2.1.4 >= 2.2.0, < 2.2.3 >= 2.3.0, < 2.3.3 >= 2.4.0, < 2.4.2

Fixed in 4 releases; the minimum fixed version depends on the release line you run. How to fix ↓

Also tracked for

The same CVE-2021-29570 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 Your last release was probably never penetration tested 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 end-to-end open source platform for machine learning. It provides a comprehensive set of tools, libraries, and resources for building and deploying machine learning models. TensorFlow is widely used in various industries and research domains.

Vulnerability Detail

The vulnerability (CVE-2021-29570) exists in the implementation of tf.raw_ops.MaxPoolGradWithArgmax in TensorFlow. An attacker can exploit this vulnerability by supplying specially crafted inputs, which can cause reads outside the bounds of heap allocated data. The implementation uses the same value to index two different arrays, but there is no guarantee that the sizes are identical. This can lead to memory corruption and potentially allow an attacker to execute arbitrary code or cause a denial-of-service (DoS) condition.

How To Fix

Fixed versions by release line

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

  • < 2.1.4 2.1.4
  • >= 2.2.0, < 2.2.3 2.2.3
  • >= 2.3.0, < 2.3.3 2.3.3
  • >= 2.4.0, < 2.4.2 2.4.2

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 at the moment. It is recommended to apply the official fix or upgrade to the patched versions of TensorFlow.

Conclusion

The vulnerability in TensorFlow's tf.raw_ops.MaxPoolGradWithArgmax can lead to memory corruption and potential code execution or denial-of-service. It is crucial to upgrade to the fixed versions or apply the official fix as soon as possible. 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 resources 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 (DoS) condition.

The vulnerability affects TensorFlow versions 0.x, 2.1.4, 2.2.0 - 2.2.3, 2.3.0 - 2.3.3, 2.4.0 - 2.4.2.

To fix this vulnerability, it is recommended to upgrade to TensorFlow 2.5.0 or later. Alternatively, you can update to the patched versions 2.4.2, 2.3.3, 2.2.3, or 2.1.4.

There is no known workaround for this vulnerability. It is recommended to apply the official fix or upgrade to the patched versions.

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.1.4 2.1.4
  • >= 2.2.0, < 2.2.3 2.2.3
  • >= 2.3.0, < 2.3.3 2.3.3
  • >= 2.4.0, < 2.4.2 2.4.2

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