CVE-2021-29561: Denial of Service in TensorFlow-GPU

tensorflow-gpu Updated 02 Oct 2025

Summary

14/05/2021
Yes i
Unrated
Not published

CVE-2021-29561: 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 < 77dd114513d7796e1e2b8aece214a380af26fbf4

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-29561 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 open-source platform for machine learning that provides a comprehensive ecosystem of tools, libraries, and resources. It is widely used for developing and deploying machine learning models. TensorFlow-GPU is a variant of TensorFlow that leverages GPU acceleration for faster computation. It allows users to train and run machine learning models on GPUs, significantly improving performance. However, TensorFlow-GPU is vulnerable to a denial of service attack due to a flaw in the implementation of tf.raw_ops.LoadAndRemapMatrix.

Vulnerability Detail

The vulnerability arises from an incorrect assumption made in the implementation of tf.raw_ops.LoadAndRemapMatrix. The code assumes that the ckpt_path parameter is always a valid scalar. However, an attacker can exploit this by sending a different tensor as the first argument of LoadAndRemapMatrix. This triggers a rank check, causing a CHECK failure and terminating the process. This vulnerability can be exploited by an attacker to cause a denial of service, disrupting the availability of the TensorFlow-GPU application. The issue has been assigned CVE-2021-29561.

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 temporary workaround, users can implement input validation to ensure that the ckpt_path parameter passed to LoadAndRemapMatrix is a valid scalar. This can be done by checking the rank of the tensor and raising an error if it is not a scalar. Here is an example of how to perform this validation in Python:

import tensorflow as tf

def load_and_remap_matrix(ckpt_path):
    if tf.rank(ckpt_path) != 0:
        raise ValueError('Invalid ckpt_path')
    tf.raw_ops.LoadAndRemapMatrix(ckpt_path)

Conclusion

The vulnerability in TensorFlow-GPU can be exploited by an attacker to cause a denial of service. It is crucial for users to update their installations to the patched versions as soon as they become available. Regularly checking for updates and applying them promptly is recommended to ensure the security and stability of the application. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for tensorflow-gpu →

Share this vulnerability

FAQ

TensorFlow is an open-source platform for machine learning that provides a comprehensive ecosystem of tools, libraries, and resources. It is widely used for developing and deploying machine learning models.

TensorFlow-GPU is a variant of TensorFlow that leverages GPU acceleration for faster computation. It allows users to train and run machine learning models on GPUs, significantly improving performance.

This vulnerability allows an attacker to cause a denial of service by exploiting a flaw in the implementation of tf.raw_ops.LoadAndRemapMatrix. By sending a different tensor as the first argument, the attacker can trigger a CHECK failure and terminate the process, disrupting the availability of the TensorFlow-GPU application.

The vulnerability will be fixed in TensorFlow 2.5.0. Users are advised to update their TensorFlow-GPU installations to the patched versions as soon as they become available. It is recommended to regularly check for updates and apply them promptly.

As a temporary workaround, users can implement input validation to ensure that the ckpt_path parameter passed to LoadAndRemapMatrix is a valid scalar. This can be done by checking the rank of the tensor and raising an error if it is not a scalar.

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.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