CVE-2022-23567: Integer overflows in Tensorflow

tensorflow Updated 02 Oct 2025

Summary

09/02/2022
Yes i
High
6.5

CVE-2022-23567: Integer overflows 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-23567 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, certain versions of Tensorflow are vulnerable to integer overflows, which can lead to denial of service attacks or assert failures.

Vulnerability Detail

The vulnerability in Tensorflow arises from the implementations of Sparse*Cwise* ops. These operations are susceptible to integer overflows, which can be exploited to trigger large allocations, causing out-of-memory denial of service attacks. Additionally, the vulnerability can also result in CHECK failures when constructing new TensorShape objects, leading to assert failures and denial of service. An attacker can leverage this vulnerability to disrupt the normal functioning of Tensorflow-based applications.

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

If updating Tensorflow is not immediately feasible, users can implement a workaround by validating the shapes of input tensors and avoiding the construction of large TensorShape objects with user-provided dimensions. This can be achieved by replacing the call to the TensorShape constructor with a call to the BuildTensorShape static helper factory. Here is an example of the workaround in Python:

import tensorflow as tf
import numpy as np

tf.raw_ops.SparseDenseCwiseDiv(
    sp_indices=np.array([[9]]),
    sp_values=np.array([5]),
    sp_shape=np.array([92233720368., 92233720368]),
    dense=np.array([4]))

By implementing this workaround, users can mitigate the risk of exploitation until they are able to update to a patched version of Tensorflow.

Conclusion

The vulnerability in Tensorflow can be mitigated by updating to one of the patched versions or implementing the provided workaround. It is crucial for users to take prompt action to protect their Tensorflow-based applications from potential exploitation. For further support and assistance in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for tensorflow →

Share this vulnerability

FAQ

Tensorflow is an open-source machine learning framework developed by Google. It provides tools and resources for building and deploying machine learning models.

The vulnerability allows attackers to trigger denial of service attacks or assert failures in Tensorflow-based applications.

To fix the vulnerability, update your Tensorflow installation to one of the patched versions: 2.5.3, 2.6.3, 2.7.1, or 2.8.0.

Yes, you can implement a workaround by validating input tensor shapes and avoiding the construction of large TensorShape objects with user-provided dimensions.

For more information about Tensorflow security, please consult the official Tensorflow security guide.

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