CVE-2021-41206: TensorFlow GPU Operations Shape Validation Vulnerability
Summary
CVE-2021-41206: TensorFlow is an open source platform for machine learning. Affects tensorflow-gpu across 9 version ranges.
< 2.4.4
>= 2.5.0, < 2.5.2
>= 2.6.0, < 2.6.1
< 4d74d8a00b07441cba090a02e0dd9ed385145bf4
< 4dddb2fd0b01cdd196101afbba6518658a2c9e07
< 68422b215e618df5ad375bcdc6d2052e9fd3080a
< 579261dcd446385831fe4f7457d802a59685121d
< da4aad5946be30e5f049920fa076e1f7ef021261
< e7f497570abb6b4ae5af4970620cd880e4c0c904
Fixed in 2.4.4, 2.5.2 or 2.6.1, depending on the release line you run. How to fix ↓
Also tracked for
- tensorflow · Bitnami
- tensorflow · PyPI
- tensorflow · PyPI
- tensorflow-cpu · PyPI
The same CVE-2021-41206 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 TensorFlow GPU package, specifically tensorflow-gpu, is a PyPI package that enables GPU acceleration for TensorFlow computations. It allows users to leverage the power of GPUs to accelerate machine learning tasks, improving performance and efficiency.
Vulnerability Detail
The TensorFlow GPU operations shape validation vulnerability (CVE-2021-41206) arises from missing validation for the shapes of tensor arguments in several TensorFlow operations. This vulnerability affects multiple versions of TensorFlow, including 2.4.4, 2.5.2, 2.6.1, and will be fixed in the upcoming release of TensorFlow 2.7.0. The absence of shape validation can lead to undefined behavior, segfaults, CHECK-fail related crashes, and potential read and write operations on heap populated arrays. The vulnerability was discovered internally while working on improving and testing GPU op determinism, and although no specific reproducers are available, multiple fixes will be implemented to address these issues.
How To Fix
Latest published version: 2.12.0 as of 22 Oct 2026
pip install --upgrade "tensorflow-gpu==2.12.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-gpu==2.4.4" -
>= 2.5.0, < 2.5.22.5.2pip install --upgrade "tensorflow-gpu==2.5.2" -
>= 2.6.0, < 2.6.12.6.1pip install --upgrade "tensorflow-gpu==2.6.1"
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 specific workaround provided for this vulnerability. However, users can mitigate the risk by updating their TensorFlow installations to the fixed versions mentioned above.
Conclusion
The TensorFlow GPU operations shape validation vulnerability (CVE-2021-41206) poses a risk to users of affected versions of TensorFlow. To mitigate this vulnerability, it is crucial to update to the fixed versions of TensorFlow, including 2.7.0, 2.6.1, 2.5.2, or 2.4.4. Regularly updating software and staying informed about security vulnerabilities is essential to ensure the safety and integrity of machine learning workflows. For further support and assistance in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for tensorflow-gpu →
FAQ
TensorFlow is an open-source platform for machine learning that provides tools and resources for developing and deploying machine learning models.
The TensorFlow GPU package, tensorflow-gpu, is a PyPI package that enables GPU acceleration for TensorFlow computations.
The vulnerability can result in undefined behavior, crashes, and potential read and write operations on heap populated arrays.
The vulnerability was discovered internally while working on improving and testing GPU op determinism.
There are no known exploits of this vulnerability at the time of this report.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow-gpu.