CVE-2021-37651: TensorFlow - Heap Buffer Overflow in tf.raw_ops.FractionalAvgPoolGrad
Summary
CVE-2021-37651: Heap buffer overflow in FractionalAvgPoolGrad in TensorFlow. Affects tensorflow across 3 version ranges.
>= 2.3.0, < 2.3.4
>= 2.4.0, < 2.4.3
>= 2.5.0, < 2.5.1
Fixed in 2.3.4, 2.4.3 or 2.5.1, depending 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-37651 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 that provides a comprehensive set of tools and libraries for developing and deploying machine learning models. It is widely used in various domains, including research, industry, and academia. TensorFlow allows users to build and train neural networks, perform data preprocessing and augmentation, and deploy models on different platforms. However, a vulnerability has been discovered in TensorFlow that can lead to a heap buffer overflow in the tf.raw_ops.FractionalAvgPoolGrad implementation.
Vulnerability Detail
The vulnerability arises due to the lack of validation for non-empty input tensors in the tf.raw_ops.FractionalAvgPoolGrad implementation. This allows an attacker to trick the code into accessing data outside the bounds of heap allocated buffers. By constructing an empty EigenDoubleMatrixMap and accessing it with indices outside the empty area, the attacker can cause a heap buffer overflow. This vulnerability can be exploited to execute arbitrary code, manipulate data, or crash the application. The issue has been patched in the latest TensorFlow versions.
How To Fix
Fixed versions by release line
The minimum fixed version depends on the release line you run.
-
>= 2.3.0, < 2.3.42.3.4 -
>= 2.4.0, < 2.4.32.4.3 -
>= 2.5.0, < 2.5.12.5.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. It is recommended to update to the patched versions of TensorFlow as mentioned in the 'how_to_fix' section.
Conclusion
The vulnerability in TensorFlow's tf.raw_ops.FractionalAvgPoolGrad implementation can lead to a heap buffer overflow, allowing attackers to execute arbitrary code or manipulate data. It is crucial to update TensorFlow to the latest patched versions to mitigate this vulnerability. For further support on vulnerability remediation, contact DevNack.com.
See every vulnerability recorded for tensorflow →
FAQ
TensorFlow is an open-source platform for machine learning that provides tools and libraries for developing and deploying machine learning models.
The vulnerability can lead to a heap buffer overflow, which can be exploited to execute arbitrary code, manipulate data, or crash the application.
The vulnerability affects TensorFlow versions 2.3.0 to 2.3.4, 2.4.0 to 2.4.3, 2.5.0, and 2.6.0-rc0 to 2.6.0-rc2.
To fix the vulnerability, update TensorFlow to the latest patched version: TensorFlow 2.6.0, TensorFlow 2.5.1, TensorFlow 2.4.3, or TensorFlow 2.3.4.
No specific workaround is provided. Updating to the patched versions is the recommended solution.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.