CVE-2021-37689: TensorFlow - Null Pointer Dereference in TFLite Model

tensorflow Updated 02 Oct 2025

Summary

12/08/2021
Yes i
High
7.8

CVE-2021-37689: TensorFlow is an end-to-end open source platform for machine learning. Affects tensorflow across 3 version ranges.

>= 2.3.0, < 2.3.4 >= 2.4.0, < 2.4.3 < d6b57f461b39fd1aa8c1b870f1b974aac3554955

Fixed in 2.3.4 or 2.4.3, depending on the release line you run. How to fix ↓

Also tracked for

The same CVE-2021-37689 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 Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

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 is widely used in various domains, including research, industry, and academia. However, a vulnerability has been discovered in TensorFlow that can be exploited by an attacker to trigger a null pointer dereference in a TFLite model, leading to a crash and denial of service.

Vulnerability Detail

The vulnerability in TensorFlow is caused by the MLIR optimization of the L2NormalizeReduceAxis operator. The implementation unconditionally dereferences a pointer to an iterator to a vector without checking if the vector has elements. This can be exploited by an attacker by crafting a malicious TFLite model that triggers the null pointer dereference. The impact of this vulnerability is a crash and denial of service. The issue has been patched in the latest versions of TensorFlow, and the fix will be included in upcoming releases.

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.0, < 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"

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

There is no specific workaround mentioned for this vulnerability. The recommended solution is to update TensorFlow to the latest version or apply the provided patch.

Conclusion

The vulnerability in TensorFlow that allows for a null pointer dereference in TFLite models can be mitigated by updating to the latest version or applying the provided patch. It is important to keep software dependencies up to date to ensure the security and stability of machine learning applications. For further support on vulnerability remediation, you can reach out to DevNack.com.

See every vulnerability recorded for tensorflow →

Share this vulnerability

FAQ

TensorFlow is an open source platform for machine learning that provides tools and resources for developing and deploying machine learning models.

The vulnerability can be exploited to trigger a null pointer dereference in a TFLite model, resulting in a crash and denial of service.

To fix this vulnerability, update TensorFlow to the latest version or apply the provided patch.

Yes, older versions of TensorFlow, including 2.3.4, 2.4.3, and 2.5.1, are also affected by this vulnerability.

You can find more information about this vulnerability in the official TensorFlow documentation or the vulnerability advisory on the PyPI advisory database.

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.0, < 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"

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