CVE-2021-29536: Heap Buffer Overflow in TensorFlow
Summary
CVE-2021-29536: Heap buffer overflow in QuantizedReshape. 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 · PyPI
- tensorflow · PyPI
- tensorflow-cpu · PyPI
- tensorflow-gpu · PyPI
The same CVE-2021-29536 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 end-to-end 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. However, a vulnerability has been identified in TensorFlow that can lead to a heap buffer overflow.
Vulnerability Detail
The vulnerability, identified as CVE-2021-29536, exists in the QuantizedReshape function of TensorFlow. It can be exploited by an attacker by passing invalid thresholds for the quantization. The implementation assumes that the arguments are valid scalars and directly accesses the numeric value. However, if any of the tensors is empty, accessing the element at position 0 results in a heap buffer overflow. This vulnerability can have severe consequences, including potential remote code execution or denial of service.
How To Fix
Fixed versions by release line
The minimum fixed version depends on the release line you run.
-
< 2.1.42.1.4 -
>= 2.2.0, < 2.2.32.2.3 -
>= 2.3.0, < 2.3.32.3.3 -
>= 2.4.0, < 2.4.22.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 currently no known workaround for this vulnerability. It is recommended to apply the official fix or update to the patched versions of TensorFlow.
Conclusion
The identified vulnerability in TensorFlow can result in a heap buffer overflow, posing significant security risks. Users are strongly advised to update their TensorFlow installations to the fixed versions as soon as they become available. 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 a comprehensive set of tools and resources for developing and deploying machine learning models.
This vulnerability can lead to a heap buffer overflow, which can have severe consequences, including potential remote code execution or denial of service.
The vulnerability will be fixed in TensorFlow 2.5.0. Users are advised to update their installations to the fixed versions as soon as they become available.
Yes, older versions of TensorFlow, including 2.4.2, 2.3.3, 2.2.3, and 2.1.4, are also affected by this vulnerability.
There is currently no known workaround for this vulnerability. It is recommended to apply the official fix or update to the patched versions of TensorFlow.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.