CVE-2021-37677: TensorFlow-CPU - Denial of Service Vulnerability in tf.raw_ops.Dequantize
Summary
CVE-2021-37677: TensorFlow is an end-to-end open source platform for machine learning. Affects tensorflow-cpu across 3 version ranges.
>= 2.3.0, < 2.3.4
>= 2.4.0, < 2.4.3
< da857cfa0fde8f79ad0afdbc94e88b5d4bbec764
Fixed in 2.3.4 or 2.4.3, depending 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-37677 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-CPU is a specific package that focuses on running TensorFlow on CPUs. It is widely used in various industries and research domains for machine learning tasks.
Vulnerability Detail
The vulnerability identified as CVE-2021-37677 affects the shape inference code for tf.raw_ops.Dequantize in TensorFlow-CPU. This vulnerability can be exploited by an attacker who provides invalid arguments, leading to a denial of service (DoS) through a segmentation fault (segfault). The shape inference implementation of tf.raw_ops.Dequantize uses the axis parameter to select between two different values for minmax_rank, which is then used to retrieve tensor dimensions. However, the code assumes that axis can only be either -1 or a value greater than -1, without any validation for other values. This oversight allows an attacker to provide malicious input, triggering a segfault and causing the application to crash. The vulnerability has been patched in the TensorFlow GitHub repository with commit da857cfa0fde8f79ad0afdbc94e88b5d4bbec764. The fix will be included in TensorFlow 2.6.0, and it has also been backported to TensorFlow 2.5.1, TensorFlow 2.4.3, and TensorFlow 2.3.4, as these versions are still within the supported range.
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.3.0, < 2.3.42.3.4pip install --upgrade "tensorflow-cpu==2.3.4" -
>= 2.4.0, < 2.4.32.4.3pip install --upgrade "tensorflow-cpu==2.4.3"
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 crucial to update the TensorFlow-CPU package to the patched version as soon as possible.
Conclusion
The vulnerability in TensorFlow-CPU's tf.raw_ops.Dequantize shape inference code can lead to a denial of service (DoS) attack through a segfault. It is crucial to update the package to the latest patched version or apply the relevant patches to mitigate the risk. For further support on vulnerability remediation, you can reach out to DevNack.com.
See every vulnerability recorded for tensorflow-cpu →
FAQ
TensorFlow is an open source platform for machine learning that provides a comprehensive ecosystem of tools and resources.
TensorFlow-CPU is a specific package that focuses on running TensorFlow on CPUs.
This vulnerability can be exploited by an attacker to cause a denial of service (DoS) by crashing the application through a segfault.
To fix this vulnerability, update TensorFlow-CPU to the latest patched version (2.6.0) or apply the relevant patches for earlier versions (2.5.1, 2.4.3, or 2.3.4).
No, there is no known workaround. It is essential to update the package to the patched version.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow-cpu.