Skip to main content
← All vulnerabilities
CVE-2021-29512PYSEC-2021-149BIT-TENSORFLOW-2021-29512GHSA-4278-2V5V-65R4PYSEC-2021-440PYSEC-2021-638

Heap buffer overflow in `RaggedBinCount`

Published
Last modified
published
Not listed in CISA KEV
Fix
Fixed in 2.3.3, 2.4.2
None on Exploit-DB, Metasploit or GitHub

Summary

TensorFlow is an end-to-end open source platform for machine learning. If the `splits` argument of `RaggedBincount` does not specify a valid `SparseTensor`(https://www.tensorflow.org/api_docs/python/tf/sparse/SparseTensor), then an attacker can trigger a heap buffer overflow. This will cause a read from outside the bounds of the `splits` tensor buffer in the implementation of the `RaggedBincount` op(https://github.com/tensorflow/tensorflow/blob/8b677d79167799f71c42fd3fa074476e0295413a/tensorflow/core/kernels/bincount_op.cc#L430-L433). Before the `for` loop, `batch_idx` is set to 0. The user controls the `splits` array, making it contain only one element, 0. Thus, the code in the `while` loop would increment `batch_idx` and then try to read `splits(1)`, which is outside of bounds. The fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2 and TensorFlow 2.3.3, as these are also affected.

Timeline

  1. CVE published
  2. Record last updated

Affected versions

  • tensorflow tensorflow

    From 2.3.0 · fixed in 2.3.3; From 2.4.0 · fixed in 2.4.2

  • tensorflowPyPI

    From 2.3.0 · fixed in 2.3.3; From 2.4.0 · fixed in 2.4.2

  • tensorflowPyPI

    From 2.3.0 · fixed in 2.3.3

  • tensorflowPyPI

    From 2.4.0 · fixed in 2.4.2

  • tensorflow-cpuPyPI

    From 2.3.0 · fixed in 2.3.3

  • tensorflow-cpuPyPI

    From 2.4.0 · fixed in 2.4.2

  • tensorflow-gpuPyPI

    From 2.3.0 · fixed in 2.3.3

  • tensorflow-gpuPyPI

    From 2.4.0 · fixed in 2.4.2

  • tensorflow-cpuPyPI

    From 2.3.0 · fixed in 2.3.3; From 2.4.0 · fixed in 2.4.2

  • tensorflow-gpuPyPI

    From 2.3.0 · fixed in 2.3.3; From 2.4.0 · fixed in 2.4.2

References 2

GitHub · tensorflow/tensorflow