CVE-2021-41223: TensorFlow CPU - Heap Out-of-Bounds Access in FusedBatchNorm Kernels
Summary
CVE-2021-41223: TensorFlow is an open source platform for machine learning. Affects tensorflow-cpu 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
< aab9998916c2ffbd8f0592059fad352622f89cda
Fixed in 4 releases; the minimum fixed version depends on the release line you run. How to fix ↓
Also tracked for
- tensorflow · Bitnami
- tensorflow · PyPI
- tensorflow · PyPI
- tensorflow-gpu · PyPI
The same CVE-2021-41223 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
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.
No signup required · Results in about 60 seconds
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 includes various components and functionalities to support different aspects of machine learning, such as data preprocessing, model building, training, and inference. One of the key features of TensorFlow is the implementation of optimized kernels for efficient computation. However, in certain versions of TensorFlow, the implementation of FusedBatchNorm kernels is vulnerable to a heap out-of-bounds (OOB) access.
Vulnerability Detail
The vulnerability in TensorFlow arises from a heap out-of-bounds access in the FusedBatchNorm kernels. This vulnerability can be exploited by an attacker to read or write data outside the bounds of allocated memory, potentially leading to information disclosure, data corruption, or even remote code execution. The issue affects multiple versions of TensorFlow, including 2.4.4, 2.5.2, 2.6.1, and 2.7.0. The TensorFlow team has addressed the vulnerability and released fixes in TensorFlow 2.7.0. Additionally, they have backported the fix to TensorFlow 2.6.1, TensorFlow 2.5.2, and TensorFlow 2.4.4 to ensure users on these versions are also protected.
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.4.42.4.4pip install --upgrade "tensorflow-cpu==2.4.4" -
>= 2.5.0, < 2.5.22.5.2pip install --upgrade "tensorflow-cpu==2.5.2" -
>= 2.6.0, < 2.6.12.6.1pip install --upgrade "tensorflow-cpu==2.6.1" -
>= 2.7.0rc0, < 2.7.02.7.0pip install --upgrade "tensorflow-cpu==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 →
Conclusion
The vulnerability in TensorFlow's FusedBatchNorm kernels can pose significant security risks, including information disclosure, data corruption, and remote code execution. It is crucial to promptly update to the latest version of TensorFlow or apply the provided fixes to mitigate the vulnerability. For further assistance and support in vulnerability remediation, you can reach out to DevNack.com.
See every vulnerability recorded for tensorflow-cpu →
FAQ
TensorFlow is an open source platform for machine learning that provides tools and libraries for developing and deploying machine learning models.
FusedBatchNorm is a kernel in TensorFlow that performs batch normalization, a technique commonly used in deep learning models to improve training stability and convergence.
The heap out-of-bounds access vulnerability in FusedBatchNorm kernels can allow an attacker to read or write data outside the bounds of allocated memory, potentially leading to information disclosure, data corruption, or remote code execution.
The vulnerability affects TensorFlow versions 2.4.4, 2.5.2, 2.6.1, and 2.7.0.
To protect your TensorFlow installation, it is recommended to upgrade to the latest version (2.7.0) or apply the respective fixes provided by the TensorFlow team for versions 2.6.1, 2.5.2, and 2.4.4.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow-cpu.