CVE-2021-37656: TensorFlow GPU - Reference Binding to Null Pointer in tf.raw_ops.RaggedTensorToSparse
Summary
CVE-2021-37656: 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
< 1071f554dbd09f7e101324d366eec5f4fe5a3ece
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-37656 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 GPU is a variant of TensorFlow that leverages GPU acceleration for faster computation. It is commonly used in scenarios where large-scale machine learning tasks require high-performance computing. However, TensorFlow GPU is vulnerable to a specific issue that allows an attacker to cause undefined behavior by binding a reference to a null pointer in the tf.raw_ops.RaggedTensorToSparse function.
Vulnerability Detail
The vulnerability in TensorFlow GPU arises from incomplete validation of the splits values in the tf.raw_ops.RaggedTensorToSparse implementation. The implementation fails to check that the splits values are in increasing order, which can lead to undefined behavior. An attacker can exploit this vulnerability to cause unexpected program behavior, potentially leading to crashes, data corruption, or even remote code execution. The vulnerability has been assigned the identifier CVE-2021-37656 and has been patched in TensorFlow commit 1071f554dbd09f7e101324d366eec5f4fe5a3ece. 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.
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, if updating TensorFlow GPU is not immediately feasible, you can consider avoiding the usage of the tf.raw_ops.RaggedTensorToSparse function or ensuring that the splits values passed to the function are always in increasing order. By manually validating the splits values, you can reduce the risk of encountering the undefined behavior caused by the vulnerability.
Conclusion
In conclusion, TensorFlow GPU is susceptible to a vulnerability that allows an attacker to bind a reference to a null pointer in the tf.raw_ops.RaggedTensorToSparse function. This can result in undefined behavior and potential security risks. It is crucial to update TensorFlow GPU to the latest patched version or one of the backported versions to mitigate this vulnerability. If you require further assistance or support in addressing this vulnerability, please contact DevNack.com.
See every vulnerability recorded for tensorflow-gpu →
FAQ
TensorFlow GPU is a variant of TensorFlow that utilizes GPU acceleration for faster computation in machine learning tasks.
The vulnerability allows an attacker to cause undefined behavior in TensorFlow GPU, potentially leading to crashes, data corruption, or remote code execution.
To fix the vulnerability, update TensorFlow GPU to the latest patched version (2.6.0 or later) or consider updating to one of the backported versions (2.5.1, 2.4.3, or 2.3.4).
As a workaround, you can avoid using the tf.raw_ops.RaggedTensorToSparse function or ensure that the splits values passed to the function are always in increasing order.
You can find more information about this vulnerability in the TensorFlow GitHub repository and the associated CVE identifier (CVE-2021-37656).
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow-gpu.