CVE-2021-29568: TensorFlow GPU - Null Pointer Dereference in tf.raw_ops.ParameterizedTruncatedNormal

tensorflow-gpu Updated 02 Oct 2025

Summary

14/05/2021
Yes i
Unrated
Not published

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

>= 2.2.0, < 2.3.0rc0 < 2.2.0rc0 >= 2.3.0, < 2.3.4 >= 2.4.0, < 2.4.3 < 5e52ef5a461570cfb68f3bdbbebfe972cb4e0fd8

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-29568 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 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 domains for deep learning tasks.

Vulnerability Detail

The vulnerability (CVE-2021-29568) exists in the tf.raw_ops.ParameterizedTruncatedNormal function of TensorFlow GPU. An attacker can trigger undefined behavior by binding to a null pointer. The vulnerability arises due to the lack of input argument validation in the implementation of the function. Specifically, the implementation does not check the shape argument before accessing the first element of the shape_tensor.flat<T>() array. If the shape argument is empty, the array will be empty as well, leading to undefined behavior. The impact of this vulnerability can range from crashes and unexpected program behavior to potential remote code execution.

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.2.0rc0 2.2.0rc0
    pip install --upgrade "tensorflow-gpu==2.2.0rc0"
  • >= 2.2.0, < 2.3.0rc0 2.3.0rc0
    pip install --upgrade "tensorflow-gpu==2.3.0rc0"
  • >= 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

As a temporary workaround, users can manually validate the shape argument before invoking the tf.raw_ops.ParameterizedTruncatedNormal function. By ensuring that the shape argument is not empty, the null pointer dereference can be avoided. Here's an example of how to perform the validation in Python:

import tensorflow as tf

def safe_parameterized_truncated_normal(shape, dtype=tf.float32, seed=None):
    if not shape:
        raise ValueError('Shape argument cannot be empty')
    return tf.raw_ops.ParameterizedTruncatedNormal(shape=shape, dtype=dtype, seed=seed)

By using this safe_parameterized_truncated_normal function instead of directly calling tf.raw_ops.ParameterizedTruncatedNormal, the vulnerability can be mitigated.

Conclusion

In conclusion, the vulnerability (CVE-2021-29568) in TensorFlow GPU's tf.raw_ops.ParameterizedTruncatedNormal function can lead to undefined behavior and potential security risks. It is crucial to update to the latest patched version of TensorFlow GPU or apply the provided workaround to mitigate the vulnerability. 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 set of tools 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 domains for deep learning tasks.

The impact of this vulnerability can range from crashes and unexpected program behavior to potential remote code execution.

The vulnerability will be fixed in TensorFlow 2.5.0. It is recommended to update to the latest patched version of TensorFlow GPU to mitigate the vulnerability.

Yes, a temporary workaround is to manually validate the shape argument before invoking the vulnerable function. By ensuring that the shape argument is not empty, the null pointer dereference can be avoided.

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.2.0rc0 2.2.0rc0
    pip install --upgrade "tensorflow-gpu==2.2.0rc0"
  • >= 2.2.0, < 2.3.0rc0 2.3.0rc0
    pip install --upgrade "tensorflow-gpu==2.3.0rc0"
  • >= 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