CVE-2022-23566: TensorFlow: heap OOB write in Grappler, RCE risk
HIGH PoC AVAILABLE CISA: ATTENDThis heap out-of-bounds write in TensorFlow's graph optimizer (Grappler) is network-exploitable with low privileges and no user interaction—a dangerous combination for any ML serving infrastructure. Any TensorFlow deployment accepting model inputs from low-trust users is at risk of remote code execution. Patch to TF 2.8.0, 2.7.1, 2.6.3, or 2.5.3 immediately; there are no viable workarounds.
Risk Assessment
High severity (CVSS 8.8). The combination of network accessibility, low attack complexity, and low privilege requirement makes this high-priority for remediation. TensorFlow is widely deployed in training and inference pipelines, often in multi-tenant environments. A write primitive in Grappler can be leveraged for arbitrary code execution, threatening the confidentiality, integrity, and availability of ML infrastructure. Not currently in CISA KEV, but exploit primitives are publicly documented in the GitHub advisory.
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-
Upgrade TensorFlow to 2.8.0+, or apply cherry-picks targeting 2.7.1, 2.6.3, or 2.5.3.
-
If immediate patching is blocked, restrict TF inference endpoint access to trusted principals via network ACLs or service mesh policy.
-
Run TF serving processes in isolated containers or sandboxed VMs to contain blast radius.
-
Monitor audit logs for anomalous graph submissions or unexpected Grappler-level errors that may indicate exploitation attempts.
-
Building from source: apply commit 97282c6d0d34476b6ba033f961590b783fa184cd directly.
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-23566?
This heap out-of-bounds write in TensorFlow's graph optimizer (Grappler) is network-exploitable with low privileges and no user interaction—a dangerous combination for any ML serving infrastructure. Any TensorFlow deployment accepting model inputs from low-trust users is at risk of remote code execution. Patch to TF 2.8.0, 2.7.1, 2.6.3, or 2.5.3 immediately; there are no viable workarounds.
Is CVE-2022-23566 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2022-23566, increasing the risk of exploitation.
How to fix CVE-2022-23566?
1. Upgrade TensorFlow to 2.8.0+, or apply cherry-picks targeting 2.7.1, 2.6.3, or 2.5.3. 2. If immediate patching is blocked, restrict TF inference endpoint access to trusted principals via network ACLs or service mesh policy. 3. Run TF serving processes in isolated containers or sandboxed VMs to contain blast radius. 4. Monitor audit logs for anomalous graph submissions or unexpected Grappler-level errors that may indicate exploitation attempts. 5. Building from source: apply commit 97282c6d0d34476b6ba033f961590b783fa184cd directly.
What systems are affected by CVE-2022-23566?
This vulnerability affects the following AI/ML architecture patterns: training pipelines, model serving, ML platforms, TFX/Kubeflow pipelines, federated learning infrastructure.
What is the CVSS score for CVE-2022-23566?
CVE-2022-23566 has a CVSS v3.1 base score of 8.8 (HIGH). The EPSS exploitation probability is 0.39%.
Technical Details
NVD Description
Tensorflow is an Open Source Machine Learning Framework. TensorFlow is vulnerable to a heap OOB write in `Grappler`. The `set_output` function writes to an array at the specified index. Hence, this gives a malicious user a write primitive. 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 low-privilege account on a multi-tenant ML platform—such as a shared Jupyter environment, TFX endpoint, or model-as-a-service API—crafts a malicious TensorFlow computational graph that triggers the OOB write in Grappler's set_output by supplying an out-of-range index. With control over the write primitive, the attacker overwrites function pointers or heap metadata to achieve code execution under the ML serving process identity. From there, they pivot to model storage, training datasets, or internal network resources.
Weaknesses (CWE)
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H References
- github.com/tensorflow/tensorflow/blob/a1320ec1eac186da1d03f033109191f715b2b130/tensorflow/core/framework/shape_inference.h Exploit 3rd Party
- github.com/tensorflow/tensorflow/blob/a1320ec1eac186da1d03f033109191f715b2b130/tensorflow/core/grappler/costs/graph_properties.cc Exploit 3rd Party
- github.com/tensorflow/tensorflow/commit/97282c6d0d34476b6ba033f961590b783fa184cd Patch 3rd Party
- github.com/tensorflow/tensorflow/security/advisories/GHSA-5qw5-89mw-wcg2 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