CVE-2021-37648: Incorrect validation of `SaveV2` inputs in TensorFlow

tensorflow Updated 02 Oct 2025

Summary

25/08/2021
Yes i
High
7.8

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

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.

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

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.4 2.3.4
    pip install --upgrade "tensorflow==2.3.4"
  • >= 2.4.0, < 2.4.3 2.4.3
    pip install --upgrade "tensorflow==2.4.3"
  • >= 2.5.0, < 2.5.1 2.5.1
    pip 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 →

Share this vulnerability

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.

Related vulnerabilities

Recent vulnerabilities recorded for tensorflow.

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.4 2.3.4
    pip install --upgrade "tensorflow==2.3.4"
  • >= 2.4.0, < 2.4.3 2.4.3
    pip install --upgrade "tensorflow==2.4.3"
  • >= 2.5.0, < 2.5.1 2.5.1
    pip 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 →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback