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.
What is the risk?
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.
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| TensorFlow | pip | — | No patch |
Do you use TensorFlow? You're affected.
How severe is it?
What is the attack surface?
What should I do?
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.
What does CISA's SSVC say?
Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.
How is it classified?
Which compliance frameworks are affected?
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.45%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0010.001 AI Software AML.T0025 Exfiltration via Cyber Means AML.T0029 Denial of AI Service AML.T0049 Exploit Public-Facing Application Compliance Controls Affected
What are the technical details?
Original Advisory
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)
CWE-125 — Out-of-bounds Read: The product reads data past the end, or before the beginning, of the intended buffer.
- [Implementation] Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does. When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue." Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylis
- [Architecture and Design] Use a language that provides appropriate memory abstractions.
Source: MITRE CWE corpus.
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