CVE-2021-41223: TensorFlow Heap Out-of-Bounds Access Vulnerability
Summary
CVE-2021-41223: TensorFlow is an open source platform for machine learning. Affects tensorflow 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-cpu · 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 is widely used in various domains, including research, industry, and academia. The FusedBatchNorm operation in TensorFlow is used for normalizing and scaling inputs in neural networks. This vulnerability specifically affects the implementation of FusedBatchNorm kernels in TensorFlow.
Vulnerability Detail
The vulnerability in TensorFlow's FusedBatchNorm kernels allows for a heap out-of-bounds (OOB) access. This means that an attacker can manipulate memory outside the bounds of allocated memory, potentially leading to memory corruption, crashes, or even remote code execution. The issue arises due to improper bounds checking in the affected code. An attacker could exploit this vulnerability by crafting a malicious input that triggers the OOB access, leading to the aforementioned consequences. The impact of this vulnerability depends on the context in which TensorFlow is used, but it has the potential to compromise the integrity and security of machine learning models and systems.
How To Fix
Latest published version: 2.21.0 as of 22 Oct 2026
pip install --upgrade "tensorflow==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==2.4.4" -
>= 2.5.0, < 2.5.22.5.2pip install --upgrade "tensorflow==2.5.2" -
>= 2.6.0, < 2.6.12.6.1pip install --upgrade "tensorflow==2.6.1" -
>= 2.7.0rc0, < 2.7.02.7.0pip install --upgrade "tensorflow==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 known workaround for this vulnerability. It is recommended to apply the available patches or update to the latest patched version of TensorFlow as soon as possible.
Conclusion
The vulnerability in TensorFlow's FusedBatchNorm kernels poses a significant risk to the integrity and security of machine learning models and systems. It is crucial to update TensorFlow to the latest patched version or apply the available patches as soon as possible. Regularly updating TensorFlow and other dependencies is essential to ensure the latest security fixes are in place. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for tensorflow →
FAQ
TensorFlow is an open source platform for machine learning that provides tools and resources for developing and deploying machine learning models.
The FusedBatchNorm operation in TensorFlow is used for normalizing and scaling inputs in neural networks.
A heap out-of-bounds access refers to accessing memory outside the bounds of allocated memory in the heap. It can lead to memory corruption, crashes, or even remote code execution.
An attacker can exploit this vulnerability by crafting a malicious input that triggers the heap out-of-bounds access in TensorFlow's FusedBatchNorm kernels.
The consequences of this vulnerability can include memory corruption, crashes, or even remote code execution. The impact depends on the context in which TensorFlow is used.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.