CVE-2022-23591: TensorFlow: SavedModel stack overflow via recursive GraphDef
HIGH PoC AVAILABLEAny system loading untrusted or externally-sourced TensorFlow SavedModel files is vulnerable to availability disruption via crafted recursive GraphDef fragments. Patch TensorFlow to 2.8.0, 2.7.1, 2.6.3, or 2.5.3 immediately. If your ML pipeline accepts user-uploaded models or pulls models from external registries without validation, treat those as untrusted input and sandbox the loading process.
Risk Assessment
High severity (CVSS 7.5) with network-reachable, zero-privilege, no-interaction attack path makes this straightforward to trigger remotely. Blast radius is limited to availability—no confidentiality or integrity impact—but in ML inference serving infrastructure, repeated crashes equate to service outage. Risk elevates significantly for platforms exposing model upload functionality or pulling models from shared registries without integrity verification.
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
Upgrade TensorFlow to 2.8.0, or cherry-pick fix (commit 448a168) into 2.7.1, 2.6.3, or 2.5.3.
-
INPUT VALIDATION
Validate SavedModel provenance—only load models from trusted, signed sources. Implement model artifact signing (e.g., Sigstore/cosign) in your ML pipeline.
-
SANDBOX
Run model loading in isolated subprocess or container with resource limits (ulimit -s) to contain stack overflow impact.
-
DETECT
Monitor for unexpected TF Serving/worker process crashes—repeated crash-restart cycles on model load are an indicator.
-
REGISTRY HYGIENE
Audit any community model checkpoints pulled from Hugging Face, TF Hub, or internal registries and verify against known-good hashes.
CISA SSVC Assessment
Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.
Classification
Compliance Impact
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2022-23591?
Any system loading untrusted or externally-sourced TensorFlow SavedModel files is vulnerable to availability disruption via crafted recursive GraphDef fragments. Patch TensorFlow to 2.8.0, 2.7.1, 2.6.3, or 2.5.3 immediately. If your ML pipeline accepts user-uploaded models or pulls models from external registries without validation, treat those as untrusted input and sandbox the loading process.
Is CVE-2022-23591 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2022-23591, increasing the risk of exploitation.
How to fix CVE-2022-23591?
1. PATCH: Upgrade TensorFlow to 2.8.0, or cherry-pick fix (commit 448a168) into 2.7.1, 2.6.3, or 2.5.3. 2. INPUT VALIDATION: Validate SavedModel provenance—only load models from trusted, signed sources. Implement model artifact signing (e.g., Sigstore/cosign) in your ML pipeline. 3. SANDBOX: Run model loading in isolated subprocess or container with resource limits (ulimit -s) to contain stack overflow impact. 4. DETECT: Monitor for unexpected TF Serving/worker process crashes—repeated crash-restart cycles on model load are an indicator. 5. REGISTRY HYGIENE: Audit any community model checkpoints pulled from Hugging Face, TF Hub, or internal registries and verify against known-good hashes.
What systems are affected by CVE-2022-23591?
This vulnerability affects the following AI/ML architecture patterns: model serving, training pipelines, model registries, MLOps platforms.
What is the CVSS score for CVE-2022-23591?
CVE-2022-23591 has a CVSS v3.1 base score of 7.5 (HIGH). The EPSS exploitation probability is 0.34%.
Technical Details
NVD Description
Tensorflow is an Open Source Machine Learning Framework. The `GraphDef` format in TensorFlow does not allow self recursive functions. The runtime assumes that this invariant is satisfied. However, a `GraphDef` containing a fragment such as the following can be consumed when loading a `SavedModel`. This would result in a stack overflow during execution as resolving each `NodeDef` means resolving the function itself and its nodes. 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 adversary targeting an organization's ML inference platform crafts a malicious TensorFlow SavedModel containing a GraphDef with a self-recursive function definition. They upload it to the organization's model registry (exploiting weak upload controls) or serve it via a compromised third-party model hub. When the MLOps pipeline or TF Serving instance loads the checkpoint for deployment, the recursive NodeDef resolution triggers unbounded stack growth, crashing the inference worker. In a shared multi-tenant serving infrastructure, this could deny service to all models hosted on the affected worker pod.
Weaknesses (CWE)
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H References
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