CVE-2022-41902: TensorFlow Grappler: OOB read/crash via crafted model
CRITICAL PoC AVAILABLECVE-2022-41902 is a CVSS 9.1 memory vulnerability in TensorFlow's Grappler graph optimizer, exploitable over the network with zero authentication. Any TensorFlow Serving deployment or training pipeline accepting external model inputs is at risk of process crash or memory disclosure. Patch immediately to TF 2.11.0, 2.10.1, 2.9.3, or 2.8.4, and restrict network access to inference endpoints as a compensating control.
Risk Assessment
Critical. CVSS 9.1 (AV:N/AC:L/PR:N/UI:N) means trivial remote exploitation with no authentication barrier. The Grappler graph optimization layer executes on both training and inference paths, widening the blast radius across the entire ML stack. The C:H score indicates memory disclosure risk — process memory could expose model weights, training data fragments, or in-memory API secrets. Not currently in CISA KEV, but the low complexity and zero-privilege requirement make opportunistic exploitation realistic against exposed endpoints.
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 TensorFlow to 2.11.0, or cherry-pick commit a65411a1 for supported branches (2.8.4, 2.9.3, 2.10.1).
-
Network-segment TensorFlow Serving gRPC/REST endpoints — restrict to trusted internal CIDRs only.
-
Implement model graph validation and sanitization before Grappler optimization runs on externally-supplied models.
-
Deploy process isolation and sandboxing for inference workloads to limit blast radius of memory disclosure.
-
Monitor serving processes for anomalous crash patterns, OOM events, or restart loops as exploitation indicators.
-
Audit cloud-managed TF deployments (Vertex AI, SageMaker) to confirm automatic patching status.
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-41902?
CVE-2022-41902 is a CVSS 9.1 memory vulnerability in TensorFlow's Grappler graph optimizer, exploitable over the network with zero authentication. Any TensorFlow Serving deployment or training pipeline accepting external model inputs is at risk of process crash or memory disclosure. Patch immediately to TF 2.11.0, 2.10.1, 2.9.3, or 2.8.4, and restrict network access to inference endpoints as a compensating control.
Is CVE-2022-41902 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2022-41902, increasing the risk of exploitation.
How to fix CVE-2022-41902?
1. Patch TensorFlow to 2.11.0, or cherry-pick commit a65411a1 for supported branches (2.8.4, 2.9.3, 2.10.1). 2. Network-segment TensorFlow Serving gRPC/REST endpoints — restrict to trusted internal CIDRs only. 3. Implement model graph validation and sanitization before Grappler optimization runs on externally-supplied models. 4. Deploy process isolation and sandboxing for inference workloads to limit blast radius of memory disclosure. 5. Monitor serving processes for anomalous crash patterns, OOM events, or restart loops as exploitation indicators. 6. Audit cloud-managed TF deployments (Vertex AI, SageMaker) to confirm automatic patching status.
What systems are affected by CVE-2022-41902?
This vulnerability affects the following AI/ML architecture patterns: model serving, training pipelines, inference endpoints, federated learning, MLOps pipelines.
What is the CVSS score for CVE-2022-41902?
CVE-2022-41902 has a CVSS v3.1 base score of 9.1 (CRITICAL). The EPSS exploitation probability is 0.28%.
Technical Details
NVD Description
TensorFlow is an open source platform for machine learning. The function MakeGrapplerFunctionItem takes arguments that determine the sizes of inputs and outputs. If the inputs given are greater than or equal to the sizes of the outputs, an out-of-bounds memory read or a crash is triggered. We have patched the issue in GitHub commit a65411a1d69edfb16b25907ffb8f73556ce36bb7. The fix will be included in TensorFlow 2.11.0. We will also cherrypick this commit on TensorFlow 2.8.4, 2.9.3, and 2.10.1.
Exploitation Scenario
An adversary crafts a malicious TensorFlow SavedModel where MakeGrapplerFunctionItem receives function items whose input count equals or exceeds the declared output sizes. They submit this model to a public-facing TensorFlow Serving gRPC endpoint (common in ML-as-a-service deployments). During Grappler's graph optimization pass, the OOB read triggers — either crashing the serving pod (effective DoS against the AI service) or returning adjacent process memory to the attacker, potentially leaking model weights, in-memory API credentials, or fragments of recently processed inference data. In federated learning scenarios where participants submit model updates, this vector is especially dangerous as the malicious artifact bypasses typical input validation.
Weaknesses (CWE)
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H References
- github.com/tensorflow/tensorflow/blob/master/tensorflow/core/grappler/utils/functions.cc 3rd Party
- github.com/tensorflow/tensorflow/commit/a65411a1d69edfb16b25907ffb8f73556ce36bb7 Patch 3rd Party
- github.com/tensorflow/tensorflow/security/advisories/GHSA-cg88-rpvp-cjv5 Patch 3rd Party
- github.com/YoussefJeridi/vulTenserflow Exploit
- github.com/YoussefJeridi/vulTensorflow Exploit
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