CVE-2021-41209: TensorFlow Convolution Operators Division by 0 Vulnerability
Summary
CVE-2021-41209: 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
< f2c3931113eaafe9ef558faaddd48e00a6606235
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-41209 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 implementations for various operators, including convolution operators, which are commonly used in deep learning models for tasks like image recognition and natural language processing.
Vulnerability Detail
The vulnerability identified as CVE-2021-41209 affects TensorFlow versions prior to 2.7.0. It specifically impacts the implementations for convolution operators, which perform convolutions on input tensors using filter tensors. If empty filter tensor arguments are passed to these operators, a division by zero error is triggered. 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.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 →
Workaround
There is no known workaround for this vulnerability. It is recommended to apply the provided fix by upgrading to the patched versions of TensorFlow.
Conclusion
The TensorFlow Convolution Operators Division by 0 Vulnerability (CVE-2021-41209) is a critical vulnerability that affects TensorFlow versions prior to 2.7.0. It can lead to a denial of service (DoS) condition or potential code execution. Users are strongly advised to upgrade their TensorFlow installations to the patched versions to mitigate this vulnerability. For further support and assistance with vulnerability remediation, please contact 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.
Convolution operators in TensorFlow are implementations that perform convolutions on input tensors using filter tensors. They are commonly used in deep learning models for tasks like image recognition and natural language processing.
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, you should upgrade your TensorFlow installation to version 2.7.0 or later. If you are on versions 2.6.1, 2.5.2, or 2.4.4, you should upgrade to the respective fixed versions.
There is no known workaround for this vulnerability. It is recommended to apply the provided fix by upgrading to the patched versions of TensorFlow.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow-cpu.