CVE-2022-23591: TensorFlow GraphDef Format Self-Recursive Function Vulnerability

tensorflow Updated 02 Oct 2025

Summary

06/03/2024
Yes i
High
Not published

CVE-2022-23591: Stack overflow 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-23591 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 for building and deploying machine learning models. TensorFlow uses a graph-based approach to represent and execute computations. The GraphDef format is a serialized representation of the TensorFlow computational graph. It defines the structure and operations of the graph. However, the GraphDef format does not allow self-recursive functions, which are functions that call themselves. This vulnerability arises when a GraphDef containing a self-recursive function is loaded into TensorFlow during the process of loading a SavedModel. The runtime assumes that self-recursive functions are not present, leading to a stack overflow during execution. This vulnerability has been assigned the CVE identifier CVE-2022-23591.

Vulnerability Detail

The vulnerability in TensorFlow's GraphDef format allows for the inclusion of self-recursive functions, which are not supported by the runtime. When a GraphDef containing such a function is loaded, it results in a stack overflow during execution. This can lead to a denial of service (DoS) condition, causing the application to crash or become unresponsive. The impact of this vulnerability is high, as it allows an attacker to disrupt the execution of TensorFlow models and potentially affect the availability of machine learning services.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 2.5.3 2.5.3
  • >= 2.6.0, < 2.6.3 2.6.3
  • >= 2.7.0, < 2.7.1 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

As a temporary workaround, users can manually inspect the GraphDef files and remove any self-recursive functions before loading them into TensorFlow. This can be done by modifying the GraphDef protobuf file and removing the offending function and its associated nodes. However, this workaround is not recommended for production environments, as it requires manual intervention and may introduce human error. It is strongly advised to apply the official fix provided by the TensorFlow development team.

Conclusion

The vulnerability in TensorFlow's GraphDef format allows for the inclusion of self-recursive functions, leading to a stack overflow during execution. This can result in a denial of service (DoS) condition and impact the availability of TensorFlow models. Users are advised to update their TensorFlow installations to the latest patched version and regularly check for updates to ensure the security and stability of their deployments. For further support on 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 for building and deploying machine learning models.

The GraphDef format is a serialized representation of the TensorFlow computational graph. It defines the structure and operations of the graph.

A self-recursive function is a function that calls itself. In the context of TensorFlow's GraphDef format, self-recursive functions are not allowed and can lead to a vulnerability.

The vulnerability allows an attacker to include self-recursive functions in a GraphDef file, leading to a stack overflow during execution. This can result in a denial of service (DoS) condition, affecting the availability of TensorFlow models.

To mitigate this vulnerability, it is recommended to update TensorFlow to the latest patched version once it becomes available. Regularly checking for updates and applying them promptly is crucial for maintaining the security and stability of TensorFlow deployments.

Related vulnerabilities

Recent vulnerabilities recorded for tensorflow.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 2.5.3 2.5.3
  • >= 2.6.0, < 2.6.3 2.6.3
  • >= 2.7.0, < 2.7.1 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