CVE-2021-29569: TensorFlow CPU - Out-of-Bounds Read in MaxPoolGradWithArgmax

tensorflow-cpu Updated 02 Oct 2025

Summary

14/05/2021
Yes i
Unrated
Not published

CVE-2021-29569: TensorFlow is an end-to-end open source platform for machine learning. Affects tensorflow-cpu across 5 version ranges.

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

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-29569 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 Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

TensorFlow is an end-to-end 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. The TensorFlow CPU package, available on PyPI, is a CPU-only version of TensorFlow that can be used on systems without GPU support.

Vulnerability Detail

The vulnerability (CVE-2021-29569) exists in the implementation of tf.raw_ops.MaxPoolGradWithArgmax in TensorFlow. This function is responsible for computing the gradients of the max pooling operation with argmax indices. By supplying specially crafted inputs, an attacker can trigger an out-of-bounds read in the function. The issue arises when the input_min and input_max tensors are empty, causing the function to access the first element in two arrays. As .flat<T>() returns an empty object backed by an empty array, accessing even the 0th element results in a read outside the bounds. This vulnerability can potentially lead to information disclosure or denial of service.

How To Fix

Latest published version: 2.21.0 as of 22 Oct 2026

pip install --upgrade "tensorflow-cpu==2.21.0"

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

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

  • < 2.1.4 2.1.4
    pip install --upgrade "tensorflow-cpu==2.1.4"
  • >= 2.2.0, < 2.2.3 2.2.3
    pip install --upgrade "tensorflow-cpu==2.2.3"
  • >= 2.3.0, < 2.3.3 2.3.3
    pip install --upgrade "tensorflow-cpu==2.3.3"
  • >= 2.4.0, < 2.4.2 2.4.2
    pip install --upgrade "tensorflow-cpu==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 specific workaround mentioned for this vulnerability.

Conclusion

The vulnerability (CVE-2021-29569) in TensorFlow CPU's tf.raw_ops.MaxPoolGradWithArgmax function can result in out-of-bounds reads when supplied with specially crafted inputs. This can potentially lead to information disclosure or denial of service. It is recommended to update the TensorFlow CPU package to one of the fixed versions (2.5.0, 2.4.2, 2.3.3, 2.2.3, or 2.1.4) to mitigate the vulnerability. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for tensorflow-cpu →

Share this vulnerability

FAQ

TensorFlow is an open source platform for machine learning that provides a comprehensive set of tools and libraries for developing and deploying machine learning models.

The TensorFlow CPU package is a version of TensorFlow that is optimized for running on systems without GPU support. It allows users to utilize TensorFlow's functionality on CPU-only machines.

This vulnerability can potentially lead to information disclosure or denial of service. An attacker can exploit the vulnerability by supplying specially crafted inputs to the affected function, causing it to read outside the bounds of heap allocated data.

To fix this vulnerability, users should update their TensorFlow CPU package to one of the fixed versions (2.5.0, 2.4.2, 2.3.3, 2.2.3, or 2.1.4). This can be done by running the command: pip install --upgrade tensorflow-cpu==<fixed_version>.

No specific workaround has been mentioned for this vulnerability.

Related vulnerabilities

Recent vulnerabilities recorded for tensorflow-cpu.

How To Fix

Latest published version: 2.21.0 as of 22 Oct 2026

pip install --upgrade "tensorflow-cpu==2.21.0"

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

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

  • < 2.1.4 2.1.4
    pip install --upgrade "tensorflow-cpu==2.1.4"
  • >= 2.2.0, < 2.2.3 2.2.3
    pip install --upgrade "tensorflow-cpu==2.2.3"
  • >= 2.3.0, < 2.3.3 2.3.3
    pip install --upgrade "tensorflow-cpu==2.3.3"
  • >= 2.4.0, < 2.4.2 2.4.2
    pip install --upgrade "tensorflow-cpu==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