CVE-2022-23591: TensorFlow GraphDef Format Stack Overflow Vulnerability
Summary
CVE-2022-23591: Tensorflow is an Open Source Machine Learning Framework. Affects tensorflow-cpu across 3 version ranges.
< 2.5.3
>= 2.6.0, < 2.6.3
< 448a16182065bd08a202d9057dd8ca541e67996c
Fixed in 2.5.3 or 2.6.3, depending on the release line you run. How to fix ↓
Also tracked for
- tensorflow · PyPI
- tensorflow · Bitnami
- tensorflow · PyPI
- tensorflow-gpu · PyPI
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.
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.
No signup required · Results in about 60 seconds
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 supports various formats for representing computational graphs, including the GraphDef format. The GraphDef format is used to serialize TensorFlow graphs and allows for the exchange and storage of trained models. However, a vulnerability has been discovered in the GraphDef format that can lead to a stack overflow during execution when loading a SavedModel.
Vulnerability Detail
The vulnerability arises from the fact that the GraphDef format does not enforce the restriction on self-recursive functions. The TensorFlow runtime assumes that this restriction is satisfied, but a maliciously crafted GraphDef containing a self-recursive fragment can bypass this check. When such a GraphDef is loaded as a SavedModel, it results in a stack overflow during execution. This can be exploited by an attacker to cause a denial-of-service (DoS) condition or potentially execute arbitrary code with the privileges of the TensorFlow process.
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.32.5.3pip install --upgrade "tensorflow-cpu==2.5.3" -
>= 2.6.0, < 2.6.32.6.3pip 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 →
Workaround
There is no known workaround for this vulnerability. It is recommended to update to the fixed versions of TensorFlow as mentioned in the 'how_to_fix' section.
Conclusion
The TensorFlow GraphDef format stack overflow vulnerability can be mitigated by updating to the fixed versions of TensorFlow. It is crucial to keep your software dependencies up to date to ensure the security and stability of your machine learning applications. For further assistance or support in addressing this vulnerability, please contact DevNack.com.
See every vulnerability recorded for tensorflow-cpu →
FAQ
TensorFlow is an open-source machine learning framework used for building and training neural networks.
The GraphDef format is used to serialize TensorFlow graphs and allows for the exchange and storage of trained models.
This vulnerability can lead to a stack overflow during execution, potentially causing a denial-of-service (DoS) condition or enabling the execution of arbitrary code with the privileges of the TensorFlow process.
To fix this vulnerability, update TensorFlow to one of the fixed versions: TensorFlow 2.8.0, TensorFlow 2.7.1, TensorFlow 2.6.3, or TensorFlow 2.5.3.
No, there is no known workaround for this vulnerability. Updating to the fixed versions of TensorFlow is the recommended solution.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow-cpu.