CVE-2022-23589: Null Pointer Dereference in TensorFlow's Grappler Component
Summary
CVE-2022-23589: Null pointer dereference in Grappler's IsConstant. 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-23589 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 ecosystem of tools, libraries, and resources for building and training various types of neural networks. The Grappler component in TensorFlow is responsible for optimizing and transforming computational graphs to improve performance. However, a vulnerability has been discovered in Grappler that can lead to a null pointer dereference under certain scenarios.
Vulnerability Detail
The vulnerability in Grappler's IsConstant function can be exploited when processing a SavedModel file. There are two instances where this null pointer dereference can occur. The first instance is during constant folding, where the GraphDef may lack the necessary nodes for a binary operation. If a node is missing, the corresponding mul_*child variables become null, leading to an incorrect dereference in subsequent lines. The second instance is in the IsIdentityConsumingSwitch function, where a similar null pointer dereference can occur. An attacker can manipulate a SavedModel file to trigger these null pointer dereferences, potentially leading to a denial of service or other unexpected behavior.
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
There is no specific workaround provided for this vulnerability. It is recommended to apply the patch or update to the latest version of TensorFlow as soon as possible.
Conclusion
The null pointer dereference vulnerability in TensorFlow's Grappler component can be mitigated by updating to the latest patched version of TensorFlow. It is important to promptly apply the patch or update to ensure the security and stability of machine learning models. For further support and assistance with vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for tensorflow →
FAQ
TensorFlow is an open-source machine learning framework used for developing and deploying machine learning models.
Grappler is a component in TensorFlow that optimizes and transforms computational graphs to improve performance.
A null pointer dereference occurs when a program attempts to access or dereference a memory address that is null (i.e., does not point to any valid memory location). This can lead to crashes or unexpected behavior.
Constant folding is an optimization technique in TensorFlow where constant operations are evaluated at compile-time rather than runtime, reducing computational overhead.
You can update TensorFlow by using the package manager or by manually downloading and installing the updated version from the official TensorFlow website.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.