CVE-2021-37673: TensorFlow MapStage CHECK-fail Vulnerability
Summary
CVE-2021-37673: CHECK-fail in MapStage. Affects tensorflow across 3 version ranges.
< 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 · Bitnami
- tensorflow-cpu · PyPI
- tensorflow-gpu · PyPI
The same CVE-2021-37673 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 widely used for developing and training deep learning models. It provides a comprehensive ecosystem of tools, libraries, and resources for building and deploying machine learning applications. TensorFlow is vulnerable to a CHECK-fail vulnerability in the MapStage function, which can lead to a denial of service (DoS) attack. The MapStage function is responsible for mapping input tensors to output tensors in TensorFlow's core operations.
Vulnerability Detail
The vulnerability arises from a lack of validation for the 'key' input parameter in the MapStage function. An attacker can exploit this by providing an invalid or empty tensor as the 'key' input, triggering a CHECK-fail and causing a DoS condition. The impact of this vulnerability is limited to the availability of the affected TensorFlow application. The vulnerability has been assigned a CVSS score of 5.5, indicating a moderate severity level.
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.3.42.3.4pip install --upgrade "tensorflow==2.3.4" -
>= 2.4.0, < 2.4.32.4.3pip install --upgrade "tensorflow==2.4.3" -
>= 2.5.0, < 2.5.12.5.1pip install --upgrade "tensorflow==2.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
As a workaround, users can ensure that the 'key' input parameter passed to the MapStage function is a valid non-empty tensor. This can be achieved by validating the tensor before invoking the MapStage function. Here is an example of how to perform the validation in Python:
import tensorflow as tf
key = tf.constant([], shape=[0, 0, 0, 0], dtype=tf.int64)
if key.shape.num_elements() == 0:
raise ValueError('Invalid key tensor: empty tensor')
# Invoke MapStage function with validated key tensor
# ... (rest of the code)
Conclusion
The CHECK-fail vulnerability in TensorFlow's MapStage function can lead to a denial of service (DoS) condition. It is recommended to update TensorFlow to version 2.6.0 or apply the relevant patches to mitigate the vulnerability. Users can also validate the 'key' input parameter before invoking the MapStage function as a workaround. For further support or assistance with vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for tensorflow →
FAQ
The vulnerability can be exploited to trigger a denial of service (DoS) condition in TensorFlow applications. However, it does not allow for arbitrary code execution or unauthorized access to sensitive information.
The vulnerability affects TensorFlow versions 2.3.4, 2.4.3, and 2.5.1. These versions have been patched in TensorFlow 2.6.0 and the relevant patches have been backported.
Yes, users can validate the 'key' input parameter before invoking the MapStage function to mitigate the vulnerability. The provided workaround code demonstrates how to perform the validation.
There is no information available regarding active exploitation of this vulnerability in the wild. However, it is recommended to apply the necessary updates or patches to ensure the security of TensorFlow applications.
For more information about TensorFlow security, including how to report issues and contact the TensorFlow team, please refer to the TensorFlow project's security guide available on their GitHub repository.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.