CVE-2021-29576: TensorFlow - Heap Buffer Overflow in tf.raw_ops.MaxPool3DGradGrad

tensorflow Updated 02 Oct 2025

Summary

14/05/2021
Yes i
Low
2.5

CVE-2021-29576: TensorFlow is an end-to-end open source platform for machine learning. Affects tensorflow 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 < 63c6a29d0f2d692b247f7bf81f8732d6442fad09

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-29576 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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

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 includes various operations and functions for performing tasks such as data preprocessing, model training, and inference. One of the operations, tf.raw_ops.MaxPool3DGradGrad, is responsible for computing the gradient of the gradient for a 3D max pooling operation. However, this specific implementation of MaxPool3DGradGrad is vulnerable to a heap buffer overflow.

Vulnerability Detail

The vulnerability in tf.raw_ops.MaxPool3DGradGrad arises due to the incomplete initialization of the Pool3dParameters structure. The constructor of Pool3dParameters uses OP_REQUIRES to validate conditions, and if any assertion fails during initialization, the process is interrupted, leaving the params structure with invalid data. This can lead to a heap buffer overflow, depending on the default initialized values. An attacker could potentially exploit this vulnerability to execute arbitrary code or cause a denial-of-service condition.

How To Fix

Latest published version: 2.21.0 as of 22 Oct 2026

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

As a workaround, you can avoid using the vulnerable tf.raw_ops.MaxPool3DGradGrad operation until you have updated to a fixed version of TensorFlow. If possible, you can consider using alternative operations or approaches to achieve the desired functionality.

Conclusion

The vulnerability in tf.raw_ops.MaxPool3DGradGrad in TensorFlow can lead to a heap buffer overflow, potentially enabling arbitrary code execution or causing a denial-of-service condition. It is crucial to update to the fixed versions of TensorFlow to mitigate these risks. 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 resources for developing and deploying machine learning models.

tf.raw_ops.MaxPool3DGradGrad is an operation in TensorFlow that computes the gradient of the gradient for a 3D max pooling operation.

A heap buffer overflow is a type of vulnerability where a program writes data beyond the bounds of a heap-allocated buffer. This can lead to memory corruption and potentially allow an attacker to execute arbitrary code or cause a crash.

The vulnerability in tf.raw_ops.MaxPool3DGradGrad could potentially allow an attacker to execute arbitrary code or cause a denial-of-service condition. It is important to update to a fixed version of TensorFlow to mitigate these risks.

To update TensorFlow, you can use the package manager or follow the installation instructions provided by the TensorFlow project. It is recommended to upgrade to TensorFlow 2.5.0 or the cherrypicked fixes for versions 2.4.2, 2.3.3, 2.2.3, and 2.1.4.

Related vulnerabilities

Recent vulnerabilities recorded for tensorflow.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Latest published version: 2.21.0 as of 22 Oct 2026

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