CVE-2022-23593: TensorFlow MLIR-TFRT: DoS via scalar shape segfault
HIGH PoC AVAILABLEAny TensorFlow 2.7.x deployment using MLIR-TFRT JIT compilation can be crashed remotely with no authentication required by sending scalar-shaped tensors — CVSS 7.5 with zero complexity. Patch to TensorFlow 2.8.0 immediately; if patching is delayed, isolate TF serving endpoints from untrusted network input. This is a single affected version with a confirmed fix, making remediation straightforward.
What is the risk?
High risk for internet-exposed TensorFlow inference services. CVSS AV:N/AC:L/PR:N/UI:N means any unauthenticated network attacker can trigger the crash with minimal effort — no AI/ML expertise required, just a scalar-shaped tensor input. Impact is pure availability: no data exfiltration path. The blast radius is limited to deployments specifically using the MLIR-TFRT JIT compilation path (TF 2.7.x only), but those running ML-as-a-Service with public endpoints face real disruption risk.
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?
5 steps-
PATCH
Upgrade to TensorFlow 2.8.0 (contains the fix) or apply commit 35f0fabb4c178253a964d7aabdbb15c6a398b69a.
-
WORKAROUND (if immediate patching not possible): Add input validation to reject or reshape scalar tensors before they reach MLIR-TFRT compilation.
-
NETWORK CONTROLS
Place TF Serving endpoints behind an API gateway that enforces minimum tensor rank requirements.
-
DETECTION
Monitor for abnormal process terminations or segfaults (SIGSEGV) in TensorFlow serving processes — alert on unexpected model server restarts.
-
VERIFY
Confirm your TF deployment version with
import tensorflow as tf; print(tf.__version__)— only 2.7.x is affected.
How is it classified?
Which compliance frameworks are affected?
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2022-23593?
Any TensorFlow 2.7.x deployment using MLIR-TFRT JIT compilation can be crashed remotely with no authentication required by sending scalar-shaped tensors — CVSS 7.5 with zero complexity. Patch to TensorFlow 2.8.0 immediately; if patching is delayed, isolate TF serving endpoints from untrusted network input. This is a single affected version with a confirmed fix, making remediation straightforward.
Is CVE-2022-23593 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2022-23593, increasing the risk of exploitation.
How to fix CVE-2022-23593?
1. PATCH: Upgrade to TensorFlow 2.8.0 (contains the fix) or apply commit 35f0fabb4c178253a964d7aabdbb15c6a398b69a. 2. WORKAROUND (if immediate patching not possible): Add input validation to reject or reshape scalar tensors before they reach MLIR-TFRT compilation. 3. NETWORK CONTROLS: Place TF Serving endpoints behind an API gateway that enforces minimum tensor rank requirements. 4. DETECTION: Monitor for abnormal process terminations or segfaults (SIGSEGV) in TensorFlow serving processes — alert on unexpected model server restarts. 5. VERIFY: Confirm your TF deployment version with `import tensorflow as tf; print(tf.__version__)` — only 2.7.x is affected.
What systems are affected by CVE-2022-23593?
This vulnerability affects the following AI/ML architecture patterns: model serving, training pipelines, inference infrastructure.
What is the CVSS score for CVE-2022-23593?
CVE-2022-23593 has a CVSS v3.1 base score of 7.5 (HIGH). The EPSS exploitation probability is 0.86%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0010.001 AI Software 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 Machine Learning Framework. The `simplifyBroadcast` function in the MLIR-TFRT infrastructure in TensorFlow is vulnerable to a segfault (hence, denial of service), if called with scalar shapes. If all shapes are scalar, then `maxRank` is 0, so we build an empty `SmallVector`. The fix will be included in TensorFlow 2.8.0. This is the only affected version.
Exploitation Scenario
Attacker discovers a public-facing TensorFlow Serving endpoint (e.g., a model inference API). They craft a gRPC or REST inference request with scalar (rank-0) tensors as input — trivially constructed with any TF client. The request triggers the `simplifyBroadcast` optimization pass in MLIR-TFRT; with all shapes being scalar, `maxRank` is 0 and an empty SmallVector is built without bounds checking, causing a segfault. The TF Serving process crashes, taking the inference API offline. The attacker can loop this at low cost to maintain a persistent DoS against any ML service behind that endpoint.
Weaknesses (CWE)
CWE-754 Improper Check for Unusual or Exceptional Conditions
Primary
CWE-754 Improper Check for Unusual or Exceptional Conditions CWE-754 — Improper Check for Unusual or Exceptional Conditions: The product does not check or incorrectly checks for unusual or exceptional conditions that are not expected to occur frequently during day to day operation of the product.
- [Requirements] Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. Choose languages with features such as exception handling that force the programmer to anticipate unusual conditions that may generate exceptions. Custom exceptions may need to be developed to handle unusual business-logic conditions. Be careful not to pass sensitive exceptions back to the user (CWE-209, CWE-248).
- [Implementation] Check the results of all functions that return a value and verify that the value is expected.
Source: MITRE CWE corpus.
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H References
- github.com/tensorflow/tensorflow/blob/274df9b02330b790aa8de1cee164b70f72b9b244/tensorflow/compiler/mlir/tfrt/jit/transforms/tf_cpurt_symbolic_shape_optimization.cc Exploit 3rd Party
- github.com/tensorflow/tensorflow/commit/35f0fabb4c178253a964d7aabdbb15c6a398b69a Patch 3rd Party
- github.com/tensorflow/tensorflow/security/advisories/GHSA-gwcx-jrx4-92w2 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