Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
🐍
🐍 PyPI
Not in CISA KEV
HIGH severity

CVE-2021-29579 — tensorflow

HIGHFix: tensorflow/tensorflow@a74768f

CVE-2021-29579 is a high-severity (CVSS 7.8) Buffer Overflow vulnerability in tensorflow. 1 public exploit reference exists, so weaponization risk is real. A fix is available for tensorflow — see the affected versions and patch details below.

Heap buffer overflow in `MaxPoolGrad`

Also known asBIT-tensorflow-2021-29579GHSA-79fv-9865-4qcvPYSEC-2021-216PYSEC-2021-507PYSEC-2021-705
Published
Updated
Affected
12 pkgs
Patched
12 / 12
Exploits
1 known
Exploitation data as of Oct 10, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

EPSS Exploitation Probability

via FIRST.org ↗
0.2%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs11th percentile — riskier than 11% of all scored CVEsHighest risk
0.00%0.24%0.48%0.71%0.0%0.2%Apr 26Aug 26Oct 26

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

How urgent is this, really

CVE-2021-29579 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.

Where this sits among everything scored

Of 385,386 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.

Real-World Exposure

12 pkgs affected
🐍tensorflow🐍tensorflow🐍tensorflow🐍tensorflow🐍tensorflow-cpu🐍tensorflow-cpu🐍tensorflow-cpu🐍tensorflow-cpu+4 more

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.

Description

Impact

The implementation of tf.raw_ops.MaxPoolGrad is vulnerable to a heap buffer overflow:

import tensorflow as tf

orig_input = tf.constant([0.0], shape=[1, 1, 1, 1], dtype=tf.float32)
orig_output = tf.constant([0.0], shape=[1, 1, 1, 1], dtype=tf.float32)
grad = tf.constant([], shape=[0, 0, 0, 0], dtype=tf.float32)
ksize = [1, 1, 1, 1] 
strides = [1, 1, 1, 1]
padding = "SAME"

tf.raw_ops.MaxPoolGrad(
  orig_input=orig_input, orig_output=orig_output, grad=grad, ksize=ksize,
  strides=strides, padding=padding, explicit_paddings=[])

The implementation fails to validate that indices used to access elements of input/output arrays are valid:

for (int index = out_start; index < out_end; ++index) {
  int input_backprop_index = out_arg_max_flat(index);
  FastBoundsCheck(input_backprop_index - in_start, in_end - in_start);
  input_backprop_flat(input_backprop_index) += out_backprop_flat(index);
}

Whereas accesses to input_backprop_flat are guarded by FastBoundsCheck, the indexing in out_backprop_flat can result in OOB access.

Patches

We have patched the issue in GitHub commit a74768f8e4efbda4def9f16ee7e13cf3922ac5f7.

The fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2, TensorFlow 2.3.3, TensorFlow 2.2.3 and TensorFlow 2.1.4, as these are also affected and still in supported range.

For more information

Please consult our security guide for more information regarding the security model and how to contact us with issues and questions.

Attribution

This vulnerability has been reported by Ying Wang and Yakun Zhang of Baidu X-Team.

Affected Packages

12 total 12 fixed
EcosystemPackageVulnerable rangeFix
🐍PyPItensorflowall versions2.1.4pip install --upgrade 'tensorflow==2.1.4'
🐍PyPItensorflow≥ 2.2.0&&< 2.2.32.2.3pip install --upgrade 'tensorflow==2.2.3'
🐍PyPItensorflow≥ 2.3.0&&< 2.3.32.3.3pip install --upgrade 'tensorflow==2.3.3'
🐍PyPItensorflow≥ 2.4.0&&< 2.4.22.4.2pip install --upgrade 'tensorflow==2.4.2'
🐍PyPItensorflow-cpuall versions2.1.4pip install --upgrade 'tensorflow-cpu==2.1.4'
🐍PyPItensorflow-cpu≥ 2.2.0&&< 2.2.32.2.3pip install --upgrade 'tensorflow-cpu==2.2.3'

Affected Products

1 product · 4 configurations
Application
tensorflowgoogle
≥ 2.4.0 && < 2.4.2
range
Exploits & PoCs
1

Research use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for tensorflow, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update tensorflow to 2.1.4 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2021-29579 is resolved across your whole dependency graph.

  3. Workarounds

    Stop feeding it untrusted input: reject or quarantine files and payloads from unverified sources until you can upgrade, restrict accepted formats to the ones you actually need, and run the parsing or decoding step in a least-privileged sandbox or short-lived worker so a crash or corrupted read cannot reach the rest of the process.

Frequently Asked Questions

### Impact The implementation of `tf.raw_ops.MaxPoolGrad` is vulnerable to a heap buffer overflow: ```python import tensorflow as tf orig_input = tf.constant([0.0], shape=[1, 1, 1, 1], dtype=tf.float32) orig_output = tf.constant([0.0], shape=[1, 1, 1, 1], dtype=tf.float32) grad = tf.constant([], shape=[0, 0, 0, 0], dtype=tf.float32) ksize = [1, 1, 1, 1] strides = [1, 1, 1, 1] padding = "SAME" tf.raw_ops.MaxPoolGrad( orig_input=orig_input, orig_output=orig_output, grad=grad, ksize=ksize, strides=strides, padding=padding, explicit_paddings=[]) ``` The [implementation](https://github.c
O3 Security · Impact-Aware SCA

Is CVE-2021-29579 in your dependencies?

Find it across PyPI, including transitive dependencies.

CVE-2021-29579: tensorflow — Fixed in 2.1.4