CVE-2022-23580: TensorFlow: uncontrolled allocation DoS in shape inference
MEDIUM PoC AVAILABLE CISA: TRACK*Any TensorFlow deployment exposing model inference to authenticated users is vulnerable to targeted availability attacks via crafted tensor inputs. The CVSS 6.5 rating understates operational risk in production ML serving: a low-privilege API consumer can crash your inference service with a single request. Patch immediately to TF 2.8.0, 2.7.1, 2.6.3, or 2.5.3 and enforce input shape validation at the API gateway layer.
Risk Assessment
Medium severity by CVSS but operationally high-risk for ML serving infrastructure. Exploitation requires only low privileges (API key or authenticated session), no user interaction, and low complexity — making it accessible to any adversary with inference API access. Impact is confined to availability (no data exfiltration path), but in production AI systems, inference downtime directly translates to service outages and SLA violations. Organizations running multi-tenant ML platforms or exposing TensorFlow serving APIs externally face the highest exposure.
Affected Systems
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| tensorflow | pip | — | No patch |
Do you use tensorflow? You're affected.
Severity & Risk
Attack Surface
Recommended Action
6 steps-
PATCH
Upgrade to TensorFlow 2.8.0, 2.7.1, 2.6.3, or 2.5.3 — apply the fix from commit 1361fb7e.
-
VALIDATE INPUT
Enforce strict tensor shape and size limits at the API gateway before requests reach TF runtime; reject any tensor dimension exceeding expected bounds.
-
RATE LIMIT
Apply per-user/per-key rate limiting on inference endpoints to contain blast radius from abuse.
-
RESOURCE LIMITS
Configure OOM kill policies and container memory limits on inference pods to enable fast recovery.
-
DETECT
Monitor for sudden memory spikes or service restarts on inference nodes as indicators of exploitation attempts.
-
ISOLATE
Run inference services in isolated containers/processes so a crash does not cascade to adjacent services.
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-23580?
Any TensorFlow deployment exposing model inference to authenticated users is vulnerable to targeted availability attacks via crafted tensor inputs. The CVSS 6.5 rating understates operational risk in production ML serving: a low-privilege API consumer can crash your inference service with a single request. Patch immediately to TF 2.8.0, 2.7.1, 2.6.3, or 2.5.3 and enforce input shape validation at the API gateway layer.
Is CVE-2022-23580 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2022-23580, increasing the risk of exploitation.
How to fix CVE-2022-23580?
1. PATCH: Upgrade to TensorFlow 2.8.0, 2.7.1, 2.6.3, or 2.5.3 — apply the fix from commit 1361fb7e. 2. VALIDATE INPUT: Enforce strict tensor shape and size limits at the API gateway before requests reach TF runtime; reject any tensor dimension exceeding expected bounds. 3. RATE LIMIT: Apply per-user/per-key rate limiting on inference endpoints to contain blast radius from abuse. 4. RESOURCE LIMITS: Configure OOM kill policies and container memory limits on inference pods to enable fast recovery. 5. DETECT: Monitor for sudden memory spikes or service restarts on inference nodes as indicators of exploitation attempts. 6. ISOLATE: Run inference services in isolated containers/processes so a crash does not cascade to adjacent services.
What systems are affected by CVE-2022-23580?
This vulnerability affects the following AI/ML architecture patterns: model serving, training pipelines, inference endpoints, ML platform APIs.
What is the CVSS score for CVE-2022-23580?
CVE-2022-23580 has a CVSS v3.1 base score of 6.5 (MEDIUM). The EPSS exploitation probability is 0.30%.
Technical Details
NVD Description
Tensorflow is an Open Source Machine Learning Framework. During shape inference, TensorFlow can allocate a large vector based on a value from a tensor controlled by the user. 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 attacker with a valid API key to a TensorFlow Serving endpoint constructs a crafted inference request containing a tensor with an extremely large dimension value in a field that feeds into shape inference. When TF processes the request, shape_inference.cc:788-790 allocates a vector sized by the attacker-controlled value, exhausting available memory. The inference server process crashes or becomes unresponsive. The attacker can repeat this on recovery to maintain a persistent DoS condition against a competitor's AI API, an internal ML platform, or a security-critical AI decision system (e.g., fraud detection, anomaly detection). No exploit code required — a single malformed gRPC or REST inference request suffices.
Weaknesses (CWE)
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H References
- github.com/tensorflow/tensorflow/blob/a1320ec1eac186da1d03f033109191f715b2b130/tensorflow/core/framework/shape_inference.cc Exploit 3rd Party
- github.com/tensorflow/tensorflow/commit/1361fb7e29449629e1df94d44e0427ebec8c83c7 Patch 3rd Party
- github.com/tensorflow/tensorflow/security/advisories/GHSA-627q-g293-49q7 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