CVE-2021-41217: TensorFlow GPU - Null Pointer Exception in Control Flow Graph Building

tensorflow-gpu Updated 02 Oct 2025

Summary

05/11/2021
Yes i
Unrated
Not published

CVE-2021-41217: TensorFlow is an open source platform for machine learning. Affects tensorflow-gpu across 5 version ranges.

< 2.4.4 >= 2.5.0, < 2.5.2 >= 2.6.0, < 2.6.1 >= 2.7.0rc0, < 2.7.0 < 05cbebd3c6bb8f517a158b0155debb8df79017ff

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

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

TensorFlow is an 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 specific package that enables GPU acceleration for TensorFlow computations. It allows users to leverage the power of GPUs to accelerate training and inference processes in machine learning models.

Vulnerability Detail

The vulnerability identified as CVE-2021-41217 affects the process of building the control flow graph for a TensorFlow model. In certain versions of TensorFlow, there is a flaw that leads to a null pointer exception when nodes that should be paired are not. The issue arises from an assumption made in the code that the first node in the pairing always exists when encountering the second node. However, when this assumption is not met, the 'parent' node becomes a null pointer, causing a crash. This vulnerability can be exploited by an attacker to cause a denial-of-service (DoS) condition or potentially execute arbitrary code on the affected system.

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.4.4 2.4.4
    pip install --upgrade "tensorflow-gpu==2.4.4"
  • >= 2.5.0, < 2.5.2 2.5.2
    pip install --upgrade "tensorflow-gpu==2.5.2"
  • >= 2.6.0, < 2.6.1 2.6.1
    pip install --upgrade "tensorflow-gpu==2.6.1"
  • >= 2.7.0rc0, < 2.7.0 2.7.0
    pip install --upgrade "tensorflow-gpu==2.7.0"

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 provided for this vulnerability. The recommended approach is to update TensorFlow GPU to the fixed versions mentioned above.

Conclusion

The vulnerability identified as CVE-2021-41217 in TensorFlow GPU poses a risk of a null pointer exception during the control flow graph building process. This can lead to a crash or potential execution of arbitrary code. To mitigate this vulnerability, it is crucial to update TensorFlow GPU to the fixed versions, such as 2.7.0, 2.6.1, 2.5.2, or 2.4.4. 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 package that enables GPU acceleration for TensorFlow computations, allowing users to leverage the power of GPUs for faster training and inference in machine learning models.

A control flow graph represents the flow of operations and dependencies in a TensorFlow model. It is used to define the execution order of operations and track data dependencies between nodes.

This vulnerability can lead to a null pointer exception, causing a crash in the control flow graph building process. In some cases, it may allow an attacker to execute arbitrary code or cause a denial-of-service (DoS) condition on the affected system.

No, not all versions of TensorFlow GPU are affected. The vulnerability exists in versions 2.4.4 and above, including 2.5.2, 2.6.1, and 2.7.0rc0. Earlier versions are not impacted.

There is no known exploit for this vulnerability at the time of this advisory. However, it is recommended to apply the necessary updates to mitigate the risk.

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.4.4 2.4.4
    pip install --upgrade "tensorflow-gpu==2.4.4"
  • >= 2.5.0, < 2.5.2 2.5.2
    pip install --upgrade "tensorflow-gpu==2.5.2"
  • >= 2.6.0, < 2.6.1 2.6.1
    pip install --upgrade "tensorflow-gpu==2.6.1"
  • >= 2.7.0rc0, < 2.7.0 2.7.0
    pip install --upgrade "tensorflow-gpu==2.7.0"

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