CVE-2021-37645: TensorFlow CPU - Integer Overflow in QuantizeAndDequantizeV4Grad

tensorflow-cpu Updated 02 Oct 2025

Summary

12/08/2021
Yes i
Unrated
Not published

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

>= 2.3.0, < 2.3.4 >= 2.4.0, < 2.4.3 < 96f364a1ca3009f98980021c4b32be5fdcca33a1

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-37645 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 Penetration testing for web, API and mobile 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 building and deploying machine learning models. TensorFlow CPU is a specific package within TensorFlow that focuses on CPU-based computations. It is widely used in various industries and research fields for machine learning tasks.

Vulnerability Detail

The vulnerability (CVE-2021-37645) exists in the implementation of tf.raw_ops.QuantizeAndDequantizeV4Grad in TensorFlow CPU. It is caused by an integer overflow issue that occurs when converting a signed integer value to an unsigned one and then allocating memory based on this value. The vulnerability arises from the use of the axis value as the size argument to the absl::InlinedVector constructor, which expects an unsigned type. Due to the implicit conversion, a negative value can be transformed into a large integer, leading to memory corruption or other unintended consequences. This vulnerability can be exploited by an attacker to execute arbitrary code or cause a denial-of-service condition.

How To Fix

Latest published version: 2.21.0 as of 22 Oct 2026

pip install --upgrade "tensorflow-cpu==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-cpu==2.3.4"
  • >= 2.4.0, < 2.4.3 2.4.3
    pip install --upgrade "tensorflow-cpu==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 provided for this vulnerability. The recommended approach is to update TensorFlow CPU to the patched version.

Conclusion

The vulnerability (CVE-2021-37645) in TensorFlow CPU's tf.raw_ops.QuantizeAndDequantizeV4Grad function poses a risk to systems running TensorFlow CPU. It is recommended to update to the patched version (2.6.0) or apply the relevant patches to mitigate the vulnerability. Users can use the Vulert Playground at https://vulert.com/scanner to check if their TensorFlow CPU installation is affected. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for tensorflow-cpu →

Share this vulnerability

FAQ

TensorFlow CPU is a package within TensorFlow that focuses on CPU-based computations. It provides support for running TensorFlow models on systems without GPU acceleration.

This vulnerability can be exploited by an attacker to execute arbitrary code or cause a denial-of-service condition. It poses a risk to systems running TensorFlow CPU.

The vulnerability affects TensorFlow CPU versions 2.3.0 to 2.3.4, 2.4.0 to 2.4.3, and any versions prior to 2.3.0.

You can use the Vulert Playground at Vulert Scanner to check if your application is affected by this vulnerability. It analyzes your Pipfile.lock and provides real-time alerts for open-source vulnerabilities.

You can find more information about this vulnerability in the TensorFlow CPU advisory PYSEC-2021-558 at https://github.com/pypa/advisory-database/blob/main/vulns/tensorflow-cpu/PYSEC-2021-558.yaml.

Related vulnerabilities

Recent vulnerabilities recorded for tensorflow-cpu.

How To Fix

Latest published version: 2.21.0 as of 22 Oct 2026

pip install --upgrade "tensorflow-cpu==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-cpu==2.3.4"
  • >= 2.4.0, < 2.4.3 2.4.3
    pip install --upgrade "tensorflow-cpu==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