CVE-2022-23578: TensorFlow Memory Leak Vulnerability
Summary
CVE-2022-23578: Memory leak 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
- tensorflow · Bitnami
- tensorflow-gpu · PyPI
- tensorflow-cpu · PyPI
The same CVE-2022-23578 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 library widely used for various applications, including deep learning and neural networks. It provides a flexible architecture for deploying computation across a range of platforms. However, like any complex software, it can have vulnerabilities that may impact its performance and reliability. The specific vulnerability discussed here involves a memory leak in the TensorFlow library, which can lead to inefficient memory usage and potential application crashes.
Vulnerability Detail
The vulnerability arises from a memory leak in the implementation of the ImmutableExecutorState::Initialize function in TensorFlow. When an invalid graph node is encountered, TensorFlow fails to properly deallocate memory associated with the OpKernel pointer, leading to memory leaks. This can result in increased memory consumption over time, potentially causing applications to run out of memory and crash. The issue is particularly concerning for applications that rely on TensorFlow for large-scale computations, as it can degrade performance and stability.
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.32.5.3pip install --upgrade "tensorflow==2.5.3" -
>= 2.6.0, < 2.6.32.6.3pip install --upgrade "tensorflow==2.6.3" -
>= 2.7.0, < 2.7.12.7.1pip 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
Currently, there are no specific workarounds mentioned for this vulnerability. The best course of action is to update to the patched version of TensorFlow as soon as it is available.
Conclusion
In summary, CVE-2022-23578 is a memory leak vulnerability in TensorFlow that can lead to significant memory issues in applications. Users are strongly encouraged to update to the latest patched versions to mitigate the risks associated with this vulnerability. Utilizing tools like Vulert can help in monitoring and managing open-source vulnerabilities effectively.
See every vulnerability recorded for tensorflow →
FAQ
CVE-2022-23578 is a vulnerability in TensorFlow that leads to memory leaks when an invalid graph node is processed.
This vulnerability can cause increased memory usage, potentially leading to application crashes or degraded performance.
Affected versions include TensorFlow 2.5.3, 2.6.0, 2.7.0, and earlier versions prior to the patched releases.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. Check your application against this vulnerability using the Vulert playground at Vulert Scanner.
While there are no specific workarounds, it is advisable to monitor your application for memory usage and plan to update to the patched version as soon as possible.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.