CVE-2022-21738: Integer overflow leading to crash in Tensorflow

tensorflow Updated 02 Oct 2025

Summary

09/02/2022
Yes i
High
6.5

CVE-2022-21738: Integer overflow leading to crash in Tensorflow. Affects tensorflow across 3 version ranges.

< 2.5.3 >= 2.6.0, < 2.6.3 >= 2.7.0, < 2.7.1

Fixed in 2.5.3, 2.6.3 or 2.7.1, depending on the release line you run. How to fix ↓

Also tracked for

The same CVE-2022-21738 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 open-source machine learning framework developed by Google. It provides a comprehensive ecosystem of tools, libraries, and resources for building 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 lead to a crash due to an integer overflow.

Vulnerability Detail

The vulnerability in Tensorflow is caused by an integer overflow in the implementation of SparseCountSparseOutput. This integer overflow can result in a crash of the Tensorflow process. The overflowed value is then used in a memory allocation, leading to a crash. An attacker could potentially exploit this vulnerability to cause a denial of service (DoS) attack by crashing a Tensorflow process. The impact of this vulnerability is considered moderate.

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.5.3 2.5.3
    pip install --upgrade "tensorflow==2.5.3"
  • >= 2.6.0, < 2.6.3 2.6.3
    pip install --upgrade "tensorflow==2.6.3"
  • >= 2.7.0, < 2.7.1 2.7.1
    pip install --upgrade "tensorflow==2.7.1"

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.

Conclusion

The vulnerability in Tensorflow has been patched in the latest versions, and users are advised to update their installations to mitigate the risk. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for tensorflow →

Share this vulnerability

FAQ

The impact of this vulnerability is considered moderate. It can lead to a crash of the Tensorflow process, potentially causing a denial of service (DoS) attack.

To fix the vulnerability, update your Tensorflow installation to the latest patched version (2.8.0 or later).

Yes, earlier versions of Tensorflow (2.7.1, 2.6.3, and 2.5.3) are also affected by this vulnerability. It is recommended to update to the latest patched version.

No, this vulnerability does not have a remote exploitation vector. An attacker would need to have local access to the Tensorflow process to exploit it.

This vulnerability was reported by Faysal Hossain Shezan from the University of Virginia.

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.5.3 2.5.3
    pip install --upgrade "tensorflow==2.5.3"
  • >= 2.6.0, < 2.6.3 2.6.3
    pip install --upgrade "tensorflow==2.6.3"
  • >= 2.7.0, < 2.7.1 2.7.1
    pip install --upgrade "tensorflow==2.7.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