CVE-2021-29583: TensorFlow-CPU FusedBatchNorm Heap Buffer Overflow

tensorflow-cpu Updated 02 Oct 2025

Summary

14/05/2021
Yes i
Unrated
Not published

CVE-2021-29583: 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 < 6972f9dfe325636b3db4e0bc517ee22a159365c0

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-29583 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 resources for developing and deploying machine learning models. TensorFlow-CPU is a specific package that focuses on running TensorFlow on CPUs. It is widely used in various industries and research fields for machine learning tasks.

Vulnerability Detail

The vulnerability (CVE-2021-29583) exists in the implementation of tf.raw_ops.FusedBatchNorm in TensorFlow-CPU. This function is responsible for performing batch normalization, a common technique in machine learning. The vulnerability arises from a lack of validation in the function's implementation. Specifically, when the tensors scale, offset, mean, and variance (the last two only when required) have a different number of elements than the number of channels of the input tensor x, a heap buffer overflow can occur. This can lead to out-of-bounds reads, potentially resulting in memory corruption and arbitrary code execution. Additionally, if the tensors are empty, the lack of validation can trigger undefined behavior by dereferencing null pointers.

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 strongly recommended to apply the fix by upgrading to TensorFlow-CPU 2.5.0 or later.

Conclusion

The vulnerability (CVE-2021-29583) in TensorFlow-CPU's tf.raw_ops.FusedBatchNorm function can lead to a heap buffer overflow and undefined behavior. It is crucial to upgrade to TensorFlow-CPU 2.5.0 or later to mitigate this vulnerability. Upgrading to the latest version ensures that you have the necessary security patches and bug fixes. For further support on vulnerability remediation, you can reach out to DevNack.com.

See every vulnerability recorded for tensorflow-cpu →

Share this vulnerability

FAQ

TensorFlow is an open source platform for machine learning that provides a comprehensive set of tools, libraries, and resources for developing and deploying machine learning models.

TensorFlow-CPU is a specific package that focuses on running TensorFlow on CPUs. It is widely used for machine learning tasks in various industries and research fields.

Batch normalization is a technique commonly used in machine learning to normalize the inputs of a neural network layer. It helps improve the training stability and performance of the model.

A heap buffer overflow occurs when a program writes data beyond the allocated memory buffer in the heap. This can lead to memory corruption and potentially allow an attacker to execute arbitrary code.

To fix the vulnerability, you should upgrade your TensorFlow-CPU package to version 2.5.0 or later. Run the command pip install --upgrade tensorflow-cpu to update the package.

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