CVE-2021-37644: TensorFlow GPU - Negative Element in num_elements List Argument of TensorListReserve

tensorflow-gpu Updated 02 Oct 2025

Summary

12/08/2021
Yes i
Unrated
Not published

CVE-2021-37644: TensorFlow is an end-to-end open source platform for machine learning. Affects tensorflow-gpu across 3 version ranges.

>= 2.3.0, < 2.3.4 >= 2.4.0, < 2.4.3 < 8a6e874437670045e6c7dc6154c7412b4a2135e2

Fixed in 2.3.4 or 2.4.3, depending on the release line you run. How to fix ↓

Also tracked for

The same CVE-2021-37644 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 for building 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 domains for deep learning tasks.

Vulnerability Detail

In affected versions of TensorFlow GPU, a vulnerability exists in the tf.raw_ops.TensorListReserve function. When a negative element is provided to the num_elements list argument, it triggers a process abort due to reallocating a std::vector with a negative number of elements. The implementation of the function fails to validate the user input, leading to this vulnerability. An attacker could exploit this issue by providing a malicious input, causing the TensorFlow runtime to crash and potentially disrupting the machine learning process. The vulnerability has been patched in the latest versions of TensorFlow, and users are advised to update to the fixed versions to mitigate the risk.

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.3.0, < 2.3.4 2.3.4
    pip install --upgrade "tensorflow-gpu==2.3.4"
  • >= 2.4.0, < 2.4.3 2.4.3
    pip install --upgrade "tensorflow-gpu==2.4.3"

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

There is no specific workaround available for this vulnerability. Users are strongly recommended to update to the patched versions of TensorFlow GPU.

Conclusion

In conclusion, TensorFlow GPU versions prior to 2.6.0 are vulnerable to a crash caused by a negative element in the num_elements list argument of tf.raw_ops.TensorListReserve. Users should update to the patched versions to mitigate the risk. For further support on vulnerability remediation, you can reach out to 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 computation in machine learning tasks.

This vulnerability allows an attacker to crash the TensorFlow GPU runtime by providing a negative element in the num_elements list argument of tf.raw_ops.TensorListReserve. This could potentially disrupt machine learning processes and lead to denial-of-service.

You can use the Vulert Playground at Vulert Scanner to check if your application is affected by this vulnerability. Simply provide your Pipfile.lock and it will analyze the dependencies for any known vulnerabilities.

No, only certain versions of TensorFlow GPU are affected. The vulnerability has been patched in TensorFlow 2.6.0 and backported to TensorFlow 2.5.1, TensorFlow 2.4.3, and TensorFlow 2.3.4. Users of these versions should update to the fixed versions.

Yes, the vulnerability has been fixed in the latest versions of TensorFlow GPU. Users should update to TensorFlow 2.6.0 or the backported fixes in TensorFlow 2.5.1, TensorFlow 2.4.3, or TensorFlow 2.3.4.

Related vulnerabilities

Recent vulnerabilities recorded for tensorflow-gpu.

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.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.3.0, < 2.3.4 2.3.4
    pip install --upgrade "tensorflow-gpu==2.3.4"
  • >= 2.4.0, < 2.4.3 2.4.3
    pip install --upgrade "tensorflow-gpu==2.4.3"

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