CVE-2021-37671: TensorFlow GPU - Null Pointer Dereference in Map Operations
Summary
CVE-2021-37671: TensorFlow is an end-to-end open source platform for machine learning. Affects tensorflow-gpu across 3 version ranges.
>= 2.3.0, < 2.3.4
>= 2.4.0, < 2.4.3
< 532f5c5a547126c634fefd43bbad1dc6417678ac
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-cpu · PyPI
The same CVE-2021-37671 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 ecosystem for developing and deploying machine learning models. It offers a wide range of tools and libraries for building and training neural networks. TensorFlow GPU is a variant of TensorFlow that leverages the power of GPUs for accelerated computation. It allows users to perform machine learning tasks with increased speed and efficiency on GPU-enabled systems.
Vulnerability Detail
The vulnerability identified as CVE-2021-37671 affects TensorFlow GPU versions 2.3.0 to 2.4.3. It revolves around the tf.raw_ops.Map* and tf.raw_ops.OrderedMap* operations, where an attacker can exploit a null pointer dereference by binding a reference to a null pointer. Although the implementation includes a check to ensure that the indices parameter is in ascending order, it fails to verify that indices is not empty. As a result, an attacker can trigger undefined behavior by providing an empty indices array. This vulnerability can lead to crashes, memory corruption, or other unpredictable outcomes.
How To Fix
Latest published version: 2.12.0 as of 22 Oct 2026
pip install --upgrade "tensorflow-gpu==2.12.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-gpu==2.3.4" -
>= 2.4.0, < 2.4.32.4.3pip install --upgrade "tensorflow-gpu==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
As a workaround, users can manually check the indices array before invoking the affected operations. By ensuring that indices is not empty, the vulnerability can be mitigated. Here is an example code snippet that demonstrates the workaround:
import tensorflow as tf
# Check if indices is empty
if len(indices) > 0:
# Perform the map operation
result = tf.raw_ops.Map*(...)
else:
# Handle the empty indices case
...
Conclusion
The vulnerability identified as CVE-2021-37671 in TensorFlow GPU versions 2.3.0 to 2.4.3 can be exploited through null pointer dereference in certain map operations. It is crucial for users to update their TensorFlow GPU installation to version 2.6.0 or later to address this vulnerability. Regularly updating TensorFlow GPU is recommended to stay protected against potential security risks. For further assistance or support in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for tensorflow-gpu →
FAQ
TensorFlow GPU is a variant of TensorFlow that utilizes GPUs for accelerated computation. It enables faster and more efficient machine learning tasks on GPU-enabled systems.
The vulnerability impacts TensorFlow GPU versions 2.3.0 to 2.4.3. Users of these versions should update to TensorFlow GPU 2.6.0 or later to mitigate the vulnerability.
Exploiting this vulnerability can lead to crashes, memory corruption, or other undefined behavior. It poses a risk to the stability and security of TensorFlow GPU applications.
To fix the vulnerability, update your TensorFlow GPU installation to version 2.6.0 or later. Use the command pip install --upgrade tensorflow-gpu to upgrade to the latest version.
Yes, a workaround involves manually checking the indices array before invoking the affected operations. By ensuring that indices is not empty, the vulnerability can be mitigated.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow-gpu.