CVE-2023-25662: TensorFlow Integer Overflow in EditDistance

tensorflow Updated 02 Oct 2025

Summary

24/03/2023
Yes i
High
7.5

CVE-2023-25662: TensorFlow vulnerable to integer overflow in EditDistance. Affects tensorflow versions < 2.11.1. Fixed in 2.11.1. How to fix ↓

Also tracked for

The same CVE-2023-25662 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 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 computer vision, natural language processing, and deep learning. However, a vulnerability has been discovered in TensorFlow version 2.11.0, specifically in the EditDistance function. This vulnerability can lead to an integer overflow, resulting in a deadlock and potential denial of service.

Vulnerability Detail

The vulnerability in TensorFlow's EditDistance function arises from a flaw in the handling of empty hypothesis_shape_t. When hypothesis_shape_t is empty, the calculation of hypothesis_shape_t->NumElements() - 1 causes an integer overflow. This integer overflow can lead to a deadlock, impacting the availability of the TensorFlow application. An attacker could potentially exploit this vulnerability to disrupt the functioning of TensorFlow-based systems.

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 version below is the minimum fixed release for this vulnerability.

If you need the minimum change

2.11.1

This is the first release that contains the fix.

pip install --upgrade "tensorflow==2.11.1"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, users can modify the code to ensure that hypothesis_shape_t is not empty before invoking the EditDistance function. For example, the following code snippet demonstrates a workaround:

import tensorflow as tf

para = {
    'hypothesis_indices': [[]],
    'hypothesis_values': ['tmp/'],
    'hypothesis_shape': [1],
    'truth_indices': [[]],
    'truth_values': [''],
    'truth_shape': [],
    'normalize': False
}

tf.raw_ops.EditDistance(**para)

By providing a non-empty hypothesis_shape, the integer overflow can be avoided.

Conclusion

In conclusion, TensorFlow version 2.11.0 is vulnerable to an integer overflow in the EditDistance function. This vulnerability can lead to a deadlock and potential denial of service. Users are strongly advised to update their TensorFlow installations to versions 2.11.1 or 2.12.0 once they become available. Additionally, a temporary workaround is available by modifying the code to provide a non-empty hypothesis_shape. 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 a comprehensive ecosystem of tools, libraries, and resources for building and deploying machine learning models.

The vulnerability can lead to an integer overflow and subsequent deadlock, potentially resulting in a denial of service. Attackers could exploit this vulnerability to disrupt TensorFlow-based systems.

The vulnerability affects TensorFlow version 2.11.0. Users of this version should update to either 2.11.1 or 2.12.0 once available.

Yes, the vulnerability has been patched in TensorFlow 2.11.1 and will also be fixed in TensorFlow 2.12.0. Users are advised to update their installations to these versions.

Yes, a temporary workaround involves ensuring that hypothesis_shape_t is not empty before invoking the EditDistance function. This can be achieved by providing a non-empty hypothesis_shape.

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 version below is the minimum fixed release for this vulnerability.

If you need the minimum change

2.11.1

This is the first release that contains the fix.

pip install --upgrade "tensorflow==2.11.1"

Tip — Not sure which version your app runs? Vulert can match this fix to it. 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