CVE-2021-29520: Heap buffer overflow in tensorflow
Summary
CVE-2021-29520: Heap buffer overflow in Conv3DBackprop*. Affects tensorflow across 4 version ranges.
< 2.1.4
>= 2.2.0, < 2.2.3
>= 2.3.0, < 2.3.3
>= 2.4.0, < 2.4.2
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-29520 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 machine learning framework developed by Google. It provides a comprehensive ecosystem of tools, libraries, and resources for building and deploying machine learning models. TensorFlow is widely used in various domains, including research, industry, and academia. However, a vulnerability has been discovered in TensorFlow that can lead to a heap buffer overflow.
Vulnerability Detail
The vulnerability in TensorFlow is caused by missing validation between arguments to tf.raw_ops.Conv3DBackprop* operations. This can result in heap buffer overflows. The issue arises from the assumption made in the implementation that the input, filter_sizes, and out_backprop tensors have the same shape, as they are accessed in parallel. An attacker could exploit this vulnerability to execute arbitrary code or cause a denial of service.
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.1.42.1.4pip install --upgrade "tensorflow==2.1.4" -
>= 2.2.0, < 2.2.32.2.3pip install --upgrade "tensorflow==2.2.3" -
>= 2.3.0, < 2.3.32.3.3pip install --upgrade "tensorflow==2.3.3" -
>= 2.4.0, < 2.4.22.4.2pip install --upgrade "tensorflow==2.4.2"
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 update to the patched version of TensorFlow.
Conclusion
The vulnerability in TensorFlow can lead to a heap buffer overflow, potentially allowing an attacker to execute arbitrary code or cause a denial of service. It is crucial to update to the patched version of TensorFlow (2.5.0 or later) to mitigate this vulnerability. If you are using an older version, you can manually apply the patch. For further support on vulnerability remediation, you can contact DevNack.com.
See every vulnerability recorded for tensorflow →
FAQ
TensorFlow is an open-source machine learning framework developed by Google. It provides a comprehensive ecosystem of tools, libraries, and resources for building and deploying machine learning models.
A heap buffer overflow is a type of vulnerability where a program writes data beyond the bounds of a buffer allocated in the heap. This can lead to memory corruption and potentially allow an attacker to execute arbitrary code or cause a denial of service.
You can use the Vulert Playground (https://vulert.com/scanner) to check if your application is affected by this vulnerability. Simply upload your Pipfile.lock and it will provide real-time monitoring and alerts for open-source vulnerabilities in your software.
Yes, the CVSS score for this vulnerability is 2.5.
For further support on vulnerability remediation, you can contact info@devnack.com. They can provide guidance and assistance in addressing this vulnerability.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.