CVE-2022-23595: TensorFlow Null Pointer Dereference Vulnerability
Summary
CVE-2022-23595: Null pointer dereference 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-cpu · PyPI
- tensorflow-gpu · PyPI
The same CVE-2022-23595 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 developed by Google. It is widely used for building and training machine learning models, offering a flexible architecture that allows deployment across various platforms. This vulnerability arises from a null pointer dereference issue when building an XLA compilation cache, which can lead to application crashes under certain configurations.
Vulnerability Detail
The vulnerability occurs when TensorFlow attempts to access a configuration prototype that is null. Specifically, during the XLA compilation cache build process, if default settings are used, the code attempts to retrieve the visible device list from a null pointer, resulting in a crash. This issue can affect users who rely on default configurations, potentially leading to service disruptions and application instability.
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
As a temporary workaround, users can modify their TensorFlow configuration to avoid using default settings that lead to the null pointer dereference. This may involve explicitly setting the GPU options in the configuration to prevent the null pointer from being accessed.
Conclusion
The CVE-2022-23595 vulnerability in TensorFlow poses a risk of application crashes due to a null pointer dereference when default settings are used. Users are advised to update to the patched versions to mitigate this risk and ensure stable operation of their machine learning applications.
See every vulnerability recorded for tensorflow →
FAQ
CVE-2022-23595 is a vulnerability in TensorFlow that leads to a null pointer dereference, potentially causing application crashes.
You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
The vulnerability affects TensorFlow versions prior to 2.5.3, 2.6.3, and 2.7.1.
The CVSS score of this vulnerability is 5.3, indicating a moderate level of severity.
You can report issues or seek more information by consulting TensorFlow's security guide available on their GitHub repository.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.