CVE-2021-29616: TensorFlow-CPU - Null Pointer Dereference in TrySimplify

tensorflow-cpu Updated 02 Oct 2025

Summary

14/05/2021
Yes i
Unrated
Not published

CVE-2021-29616: TensorFlow is an end-to-end open source platform for machine learning. Affects tensorflow-cpu 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 < e6340f0665d53716ef3197ada88936c2a5f7a2d3

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-29616 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 Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

TensorFlow is an end-to-end open source platform for machine learning. It provides a comprehensive ecosystem of tools, libraries, and community resources that enable researchers and developers to build and deploy machine learning models. TensorFlow-CPU is a Python package that allows users to run TensorFlow on CPUs. It is widely used in various industries for machine learning tasks.

Vulnerability Detail

The vulnerability (CVE-2021-29616) exists in the TensorFlow-CPU package. It is caused by a null pointer dereference in the implementation of TrySimplify function in the arithmetic optimizer module. In certain corner cases where a node with no inputs is being optimized, the code dereferences a null pointer, leading to undefined behavior. This vulnerability can be exploited by an attacker to cause a denial-of-service (DoS) condition or potentially execute arbitrary code.

How To Fix

Latest published version: 2.21.0 as of 22 Oct 2026

pip install --upgrade "tensorflow-cpu==2.21.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-cpu==2.2.0rc0"
  • >= 2.2.0, < 2.3.0rc0 2.3.0rc0
    pip install --upgrade "tensorflow-cpu==2.3.0rc0"
  • >= 2.3.0, < 2.3.4 2.3.4
    pip install --upgrade "tensorflow-cpu==2.3.4"
  • >= 2.4.0, < 2.4.3 2.4.3
    pip install --upgrade "tensorflow-cpu==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 known workaround for this vulnerability. It is recommended to update to the patched versions of TensorFlow-CPU as mentioned in the 'how_to_fix' section.

Conclusion

The vulnerability (CVE-2021-29616) in TensorFlow-CPU can be mitigated by updating to the patched versions mentioned in the 'how_to_fix' section. It is crucial to keep software dependencies up to date to ensure the security and stability of machine learning applications. For further support on vulnerability remediation, you can contact DevNack.com.

See every vulnerability recorded for tensorflow-cpu →

Share this vulnerability

FAQ

TensorFlow is an open source platform for machine learning that provides tools and libraries for building and deploying machine learning models.

TensorFlow-CPU is a Python package that allows users to run TensorFlow on CPUs. It is a variant of TensorFlow optimized for CPU performance.

This vulnerability can be exploited by an attacker to cause a denial-of-service (DoS) condition or potentially execute arbitrary code.

To fix this vulnerability, update TensorFlow-CPU to version 2.5.0 or later. Alternatively, you can update to TensorFlow 2.4.2, TensorFlow 2.3.3, TensorFlow 2.2.3, or TensorFlow 2.1.4.

There is no known workaround for this vulnerability. It is recommended to update to the patched versions of TensorFlow-CPU.

Related vulnerabilities

Recent vulnerabilities recorded for tensorflow-cpu.

How To Fix

Latest published version: 2.21.0 as of 22 Oct 2026

pip install --upgrade "tensorflow-cpu==2.21.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-cpu==2.2.0rc0"
  • >= 2.2.0, < 2.3.0rc0 2.3.0rc0
    pip install --upgrade "tensorflow-cpu==2.3.0rc0"
  • >= 2.3.0, < 2.3.4 2.3.4
    pip install --upgrade "tensorflow-cpu==2.3.4"
  • >= 2.4.0, < 2.4.3 2.4.3
    pip install --upgrade "tensorflow-cpu==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