CVE-2022-21738: TensorFlow Integer Overflow in SparseCountSparseOutput

tensorflow-cpu Updated 02 Oct 2025

Summary

03/02/2022
Yes i
Unrated
Not published

CVE-2022-21738: Tensorflow is an Open Source Machine Learning Framework. Affects tensorflow-cpu across 3 version ranges.

< 2.5.3 >= 2.6.0, < 2.6.3 < 6f4d3e8139ec724dbbcb40505891c81dd1052c4a

Fixed in 2.5.3 or 2.6.3, 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

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

TensorFlow is an open-source machine learning framework widely used for developing and deploying machine learning models. It provides a comprehensive set of tools and libraries for building and training neural networks. TensorFlow is available on PyPI as the package 'tensorflow-cpu'.

Vulnerability Detail

The vulnerability identified as CVE-2022-21738 affects the TensorFlow framework. Specifically, the implementation of the 'SparseCountSparseOutput' function can trigger an integer overflow, leading to a crash of the TensorFlow process. This integer overflow occurs during a memory allocation, where the result of the overflow is mistakenly used. The impact of this vulnerability can result in denial of service (DoS) attacks or unexpected termination of TensorFlow processes.

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

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

Conclusion

The identified vulnerability in TensorFlow's 'SparseCountSparseOutput' function can result in a crash of TensorFlow processes, potentially leading to denial of service (DoS) attacks or unexpected termination. It is crucial to update TensorFlow installations to the patched versions (2.7.1, 2.6.3, or 2.5.3) to mitigate this vulnerability. For further support and assistance in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for tensorflow-cpu →

Share this vulnerability

FAQ

TensorFlow is an open-source machine learning framework used for developing and deploying machine learning models. It provides a comprehensive set of tools and libraries for building and training neural networks.

The vulnerability can lead to a crash of TensorFlow processes, resulting in denial of service (DoS) attacks or unexpected termination of the affected processes.

To fix this vulnerability, update your TensorFlow installation to one of the following versions: TensorFlow 2.7.1, TensorFlow 2.6.3, or TensorFlow 2.5.3. These versions include the necessary patches to mitigate the issue.

No specific workaround has been provided for this vulnerability. It is recommended to update to the patched versions of TensorFlow.

You can find more information about this vulnerability in the TensorFlow advisory database. The source for this vulnerability report can be accessed at: https://github.com/pypa/advisory-database/blob/main/vulns/tensorflow-cpu/PYSEC-2022-62.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.5.3 2.5.3
    pip install --upgrade "tensorflow-cpu==2.5.3"
  • >= 2.6.0, < 2.6.3 2.6.3
    pip install --upgrade "tensorflow-cpu==2.6.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