CVE-2022-23578: TensorFlow: memory leak via invalid graph node
MEDIUM PoC AVAILABLEAn authenticated network user can trigger memory leaks in TensorFlow's graph execution engine by submitting invalid graph nodes, eventually exhausting inference server memory and causing service disruption. Impact is strictly availability — no data exposure or code execution risk. Patch to TensorFlow 2.8.0, 2.7.1, 2.6.3, or 2.5.3; prioritize shared or multi-tenant TensorFlow serving environments where untrusted authenticated users can submit graph workloads.
Risk Assessment
Medium risk overall, but elevated in shared ML serving environments. Network-accessible with low privilege requirement and no user interaction reduces the exploitation bar significantly. Impact is limited to partial availability loss with no confidentiality or integrity implications. Not in CISA KEV and no known active exploitation, but the low complexity makes it accessible to any authenticated user — including malicious insiders or accounts compromised via credential theft.
Affected Systems
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| tensorflow | pip | — | No patch |
Do you use tensorflow? You're affected.
Severity & Risk
Attack Surface
Recommended Action
5 steps-
Patch immediately: upgrade to TensorFlow 2.8.0, or apply cherrypicked fix to 2.7.1, 2.6.3, or 2.5.3 per the GitHub advisory GHSA-8r7c-3cm2-3h8f.
-
If patching is delayed, restrict graph submission APIs to explicitly trusted principals via network policy or API gateway ACLs.
-
Enforce memory limits and OOM-kill policies on TensorFlow serving containers/pods to bound blast radius.
-
Alert on sustained memory growth above baseline on inference servers.
-
Audit which services expose TensorFlow graph execution APIs to authenticated but untrusted internal users.
Classification
Compliance Impact
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2022-23578?
An authenticated network user can trigger memory leaks in TensorFlow's graph execution engine by submitting invalid graph nodes, eventually exhausting inference server memory and causing service disruption. Impact is strictly availability — no data exposure or code execution risk. Patch to TensorFlow 2.8.0, 2.7.1, 2.6.3, or 2.5.3; prioritize shared or multi-tenant TensorFlow serving environments where untrusted authenticated users can submit graph workloads.
Is CVE-2022-23578 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2022-23578, increasing the risk of exploitation.
How to fix CVE-2022-23578?
1. Patch immediately: upgrade to TensorFlow 2.8.0, or apply cherrypicked fix to 2.7.1, 2.6.3, or 2.5.3 per the GitHub advisory GHSA-8r7c-3cm2-3h8f. 2. If patching is delayed, restrict graph submission APIs to explicitly trusted principals via network policy or API gateway ACLs. 3. Enforce memory limits and OOM-kill policies on TensorFlow serving containers/pods to bound blast radius. 4. Alert on sustained memory growth above baseline on inference servers. 5. Audit which services expose TensorFlow graph execution APIs to authenticated but untrusted internal users.
What systems are affected by CVE-2022-23578?
This vulnerability affects the following AI/ML architecture patterns: model serving, training pipelines, ml frameworks.
What is the CVSS score for CVE-2022-23578?
CVE-2022-23578 has a CVSS v3.1 base score of 4.3 (MEDIUM). The EPSS exploitation probability is 0.20%.
Technical Details
NVD Description
Tensorflow is an Open Source Machine Learning Framework. If a graph node is invalid, TensorFlow can leak memory in the implementation of `ImmutableExecutorState::Initialize`. Here, we set `item->kernel` to `nullptr` but it is a simple `OpKernel*` pointer so the memory that was previously allocated to it would leak. The fix will be included in TensorFlow 2.8.0. We will also cherrypick this commit on TensorFlow 2.7.1, TensorFlow 2.6.3, and TensorFlow 2.5.3, as these are also affected and still in supported range.
Exploitation Scenario
An authenticated insider or an attacker with compromised low-privilege credentials repeatedly submits crafted TensorFlow graph definitions containing intentionally invalid nodes to a TensorFlow Serving endpoint. Each request causes a kernel pointer to be nulled without freeing the prior allocation in ImmutableExecutorState::Initialize. After thousands of requests — trivially automated with a simple loop — the serving process exhausts available memory, triggering OOM conditions that crash the inference service or severely degrade throughput for all users. This is a low-and-slow DoS against AI inference infrastructure requiring no specialized ML knowledge.
Weaknesses (CWE)
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L References
- github.com/tensorflow/tensorflow/blob/a1320ec1eac186da1d03f033109191f715b2b130/tensorflow/core/common_runtime/immutable_executor_state.cc Exploit 3rd Party
- github.com/tensorflow/tensorflow/commit/c79ccba517dbb1a0ccb9b01ee3bd2a63748b60dd Patch 3rd Party
- github.com/tensorflow/tensorflow/security/advisories/GHSA-8r7c-3cm2-3h8f Patch 3rd Party
Timeline
Related Vulnerabilities
CVE-2020-15196 9.9 TensorFlow: heap OOB read in sparse/ragged count ops
Same package: tensorflow CVE-2020-15205 9.8 TensorFlow: heap overflow in StringNGrams, ASLR bypass
Same package: tensorflow CVE-2020-15208 9.8 TFLite: OOB read/write via tensor dimension mismatch
Same package: tensorflow CVE-2019-16778 9.8 TensorFlow: heap overflow in UnsortedSegmentSum op
Same package: tensorflow CVE-2022-23587 9.8 TensorFlow: integer overflow in Grappler enables RCE
Same package: tensorflow
AI Threat Alert