CVE-2022-35952: TensorFlow: DoS via UnbatchGradOp assertion crash
HIGH PoC AVAILABLEA remotely-exploitable denial-of-service in TensorFlow's UnbatchGradOp allows unauthenticated attackers to crash any exposed inference endpoint by sending malformed tensor inputs. No credentials or user interaction required, making this trivially weaponizable against production ML serving infrastructure. Patch to TensorFlow 2.10.0, 2.9.1, 2.8.1, or 2.7.2 immediately if running earlier versions.
Risk Assessment
CVSS 7.5 HIGH with AV:N/AC:L/PR:N/UI:N reflects worst-case DoS conditions: network-reachable, no credentials, trivial to reproduce. Impact is limited to availability—no data exfiltration or code execution possible via this vector. Not in CISA KEV with no known active exploitation, but a crashed inference endpoint can disrupt production AI services with no recovery path short of restart. Residual risk is moderate for organizations still running unpatched TF 2.7.x–2.9.x.
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-
Patch: Upgrade to TensorFlow 2.10.0, or apply cherrypicks to 2.9.1, 2.8.1, or 2.7.2 per the GitHub advisory.
-
Network controls: Restrict TensorFlow Serving API endpoints to internal networks only—never expose raw inference APIs to the public internet.
-
Input validation: Deploy a preprocessing layer validating tensor shape and dtype before passing inputs to the model.
-
Detection: Monitor inference service logs for CHECK failure messages and unexpected process crashes.
-
Resilience: Ensure serving containers have automatic restart policies configured to minimize downtime if exploitation occurs.
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-35952?
A remotely-exploitable denial-of-service in TensorFlow's UnbatchGradOp allows unauthenticated attackers to crash any exposed inference endpoint by sending malformed tensor inputs. No credentials or user interaction required, making this trivially weaponizable against production ML serving infrastructure. Patch to TensorFlow 2.10.0, 2.9.1, 2.8.1, or 2.7.2 immediately if running earlier versions.
Is CVE-2022-35952 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2022-35952, increasing the risk of exploitation.
How to fix CVE-2022-35952?
1. Patch: Upgrade to TensorFlow 2.10.0, or apply cherrypicks to 2.9.1, 2.8.1, or 2.7.2 per the GitHub advisory. 2. Network controls: Restrict TensorFlow Serving API endpoints to internal networks only—never expose raw inference APIs to the public internet. 3. Input validation: Deploy a preprocessing layer validating tensor shape and dtype before passing inputs to the model. 4. Detection: Monitor inference service logs for CHECK failure messages and unexpected process crashes. 5. Resilience: Ensure serving containers have automatic restart policies configured to minimize downtime if exploitation occurs.
What systems are affected by CVE-2022-35952?
This vulnerability affects the following AI/ML architecture patterns: model serving, training pipelines, inference APIs.
What is the CVSS score for CVE-2022-35952?
CVE-2022-35952 has a CVSS v3.1 base score of 7.5 (HIGH). The EPSS exploitation probability is 0.22%.
Technical Details
NVD Description
TensorFlow is an open source platform for machine learning. The `UnbatchGradOp` function takes an argument `id` that is assumed to be a scalar. A nonscalar `id` can trigger a `CHECK` failure and crash the program. It also requires its argument `batch_index` to contain three times the number of elements as indicated in its `batch_index.dim_size(0)`. An incorrect `batch_index` can trigger a `CHECK` failure and crash the program. We have patched the issue in GitHub commit 5f945fc6409a3c1e90d6970c9292f805f6e6ddf2. The fix will be included in TensorFlow 2.10.0. We will also cherrypick this commit on TensorFlow 2.9.1, TensorFlow 2.8.1, and TensorFlow 2.7.2, as these are also affected and still in supported range. There are no known workarounds for this issue.
Exploitation Scenario
An attacker identifies a public-facing TensorFlow Serving gRPC or REST endpoint. They craft a malformed inference request passing a nonscalar tensor for the id parameter of an operation using UnbatchGradOp, or supply a batch_index tensor with an incorrect element count. TensorFlow's internal CHECK assertion fails, raising an unhandled exception that crashes the serving process. On deployments without restart policies, the ML service becomes immediately unavailable. An attacker can automate repeated requests to sustain a persistent DoS, effectively eliminating the inference endpoint as a business capability.
Weaknesses (CWE)
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/769eddaf479c8debead9a59a72617d6ed6f0fe10/tensorflow/core/kernels/batch_kernels.cc 3rd Party
- github.com/tensorflow/tensorflow/commit/5f945fc6409a3c1e90d6970c9292f805f6e6ddf2 Patch 3rd Party
- github.com/tensorflow/tensorflow/security/advisories/GHSA-h5vq-gw2c-pq47 Patch 3rd Party
- github.com/ARPSyndicate/cvemon Exploit
- github.com/skipfuzz/skipfuzz 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