CVE-2021-37672: TensorFlow SdcaOptimizerV2 Heap Overflow

tensorflow Updated 02 Oct 2025

Summary

12/08/2021
Yes i
Moderate
5.5

CVE-2021-37672: 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 < a4e138660270e7599793fa438cd7b2fc2ce215a6

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-37672 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 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 industries and research domains for tasks such as image recognition, natural language processing, and recommendation systems. However, a vulnerability has been discovered in TensorFlow that affects the SdcaOptimizerV2 function.

Vulnerability Detail

The vulnerability (CVE-2021-37672) in TensorFlow allows an attacker to read data from outside the bounds of heap allocated memory. By sending specially crafted illegal arguments to the tf.raw_ops.SdcaOptimizerV2 function, an attacker can exploit the lack of bounds checking in the implementation. Specifically, the length of example_labels is not properly validated against the number of examples, leading to a heap overflow. This vulnerability can be exploited to read sensitive data or potentially execute arbitrary code in the context of the affected TensorFlow application. The issue has been patched in the latest versions of 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 →

Workaround

There is no known workaround for this vulnerability. It is recommended to apply the provided fix or update to the latest version of TensorFlow.

Conclusion

The vulnerability (CVE-2021-37672) in TensorFlow's SdcaOptimizerV2 function can be exploited to read data from outside the bounds of heap allocated memory. It is crucial to update TensorFlow to version 2.6.0 or later, or apply the provided patch, to mitigate the risk of data exposure or arbitrary code execution. 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 platform for machine learning that provides tools and resources for developing and deploying machine learning models.

The vulnerability allows an attacker to read data from outside the bounds of heap allocated memory, potentially leading to the exposure of sensitive information or the execution of arbitrary code.

To fix this vulnerability, update TensorFlow to version 2.6.0 or later. Alternatively, you can apply the provided patch by cherrypicking the commit a4e138660270e7599793fa438cd7b2fc2ce215a6.

Yes, older versions of TensorFlow are also affected by this vulnerability. It is recommended to update to the latest supported version or apply the provided patch.

No, there is no known workaround for this vulnerability. It is recommended to update TensorFlow to the latest version or apply the provided patch.

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