CVE-2021-29582: TensorFlow GPU - Out-of-Bounds Read Vulnerability

tensorflow-gpu Updated 02 Oct 2025

Summary

14/05/2021
Yes i
Unrated
Not published

CVE-2021-29582: TensorFlow is an end-to-end open source platform for machine learning. Affects tensorflow-gpu 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 < 5899741d0421391ca878da47907b1452f06aaf1b

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-29582 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 GPU is a variant of TensorFlow that leverages GPU acceleration for faster computation. It is widely used in various industries and research fields for deep learning tasks.

Vulnerability Detail

The vulnerability (CVE-2021-29582) in TensorFlow GPU arises from a lack of validation in the tf.raw_ops.Dequantize function. By exploiting this issue, an attacker can trigger a read from outside the bounds of heap allocated data. The vulnerable code can be found in the dequantize_op.cc file of the TensorFlow source code. The implementation fails to check that the min_range and max_range tensors have the same shape before accessing them in parallel. This oversight allows an attacker to read data beyond the intended boundaries, potentially leading to information disclosure or a crash. The vulnerability affects various versions of TensorFlow GPU, including 2.1.4, 2.2.3, 2.3.3, and 2.4.2.

How To Fix

Latest published version: 2.12.0 as of 22 Oct 2026

pip install --upgrade "tensorflow-gpu==2.12.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-gpu==2.1.4"
  • >= 2.2.0, < 2.2.3 2.2.3
    pip install --upgrade "tensorflow-gpu==2.2.3"
  • >= 2.3.0, < 2.3.3 2.3.3
    pip install --upgrade "tensorflow-gpu==2.3.3"
  • >= 2.4.0, < 2.4.2 2.4.2
    pip install --upgrade "tensorflow-gpu==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, users can consider avoiding the usage of the tf.raw_ops.Dequantize function in their code until they can update to the patched version of TensorFlow GPU. Alternatively, they can implement custom validation checks to ensure that the min_range and max_range tensors have the same shape before invoking the Dequantize operation.

Conclusion

The vulnerability (CVE-2021-29582) in TensorFlow GPU exposes users to the risk of out-of-bounds reads, potentially leading to information disclosure or application crashes. It is crucial for users to update their TensorFlow GPU installations to the latest patched version (2.5.0) or apply the backported fixes for older supported versions. By doing so, users can ensure the security and stability of their TensorFlow GPU applications. For further assistance or support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for tensorflow-gpu →

Share this vulnerability

FAQ

TensorFlow GPU is a variant of TensorFlow that utilizes GPU acceleration for faster machine learning computations. It is commonly used in deep learning tasks that require intensive computational power.

This vulnerability allows an attacker to read data from outside the intended boundaries of heap allocated memory. Depending on the specific context, this could potentially lead to information disclosure or a crash of the TensorFlow GPU application.

The vulnerability affects TensorFlow GPU versions 2.1.4, 2.2.3, 2.3.3, and 2.4.2. These versions are within the supported range and have been patched to address the issue.

Yes, the TensorFlow team has fixed the vulnerability in TensorFlow 2.5.0. They have also backported the fix to TensorFlow 2.4.2, 2.3.3, 2.2.3, and 2.1.4 to ensure that older versions within the supported range are protected.

To update your TensorFlow GPU installation, you can follow the official upgrade instructions provided by the TensorFlow project. These instructions guide you through the process of updating to the latest patched version of TensorFlow GPU.

Related vulnerabilities

Recent vulnerabilities recorded for tensorflow-gpu.

How To Fix

Latest published version: 2.12.0 as of 22 Oct 2026

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