CVE-2021-37648: Incorrect validation of `SaveV2` inputs in TensorFlow
Summary
CVE-2021-37648: Incorrect validation of SaveV2 inputs. 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-37648 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 developed by Google. It provides a comprehensive ecosystem of tools, libraries, and community resources that enable researchers and developers to build and deploy machine learning models. TensorFlow is widely used in various domains, including computer vision, natural language processing, and deep learning. However, a vulnerability has been discovered in TensorFlow that affects the validation of inputs in the SaveV2 function.
Vulnerability Detail
The vulnerability (CVE-2021-37648) in TensorFlow arises from incorrect validation of inputs in the SaveV2 function. The code does not properly validate the inputs, allowing an attacker to trigger a null pointer dereference. By exploiting this vulnerability, an attacker can cause the execution of the kernel to continue from the next line in Compute after the failed validation, leading to potential illegal states and security issues. This vulnerability has a CVSS score of 7.8, indicating a high 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 avoid the vulnerability by ensuring they are using a patched version of TensorFlow. It is recommended to update to TensorFlow 2.6.0 or apply the necessary patches for TensorFlow 2.5.1, TensorFlow 2.4.3, or TensorFlow 2.3.4.
Conclusion
In conclusion, the vulnerability (CVE-2021-37648) in TensorFlow's SaveV2 function can lead to a null pointer dereference and potential security issues. It is crucial to update to TensorFlow 2.6.0 or apply the necessary patches to ensure the security of your TensorFlow installation. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for tensorflow →
FAQ
TensorFlow is an open-source machine learning framework developed by Google. It provides tools and libraries for building and deploying machine learning models.
The vulnerability allows an attacker to trigger a null pointer dereference, potentially leading to illegal states and security issues.
To fix this vulnerability, update to TensorFlow 2.6.0 or apply the necessary patches for TensorFlow 2.5.1, TensorFlow 2.4.3, or TensorFlow 2.3.4.
As a workaround, ensure you are using a patched version of TensorFlow.
For more information, consult the TensorFlow security guide and the GitHub commit 9728c60e136912a12d99ca56e106b7cce7af5986.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.