CVE-2022-35952: TensorFlow: DoS via UnbatchGradOp assertion crash

HIGH PoC AVAILABLE
Published September 16, 2022
CISO Take

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.

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
195.0K OpenSSF 7.2 3.7K dependents Pushed 6d ago 4% patched ~1372d to patch Full package profile →

Do you use tensorflow? You're affected.

Severity & Risk

CVSS 3.1
7.5 / 10
EPSS
0.2%
chance of exploitation in 30 days
Higher than 44% of all CVEs
Exploitation Status
Exploit Available
Exploitation: MEDIUM
Sophistication
Trivial
Exploitation Confidence
medium
Public PoC indexed (trickest/cve)
Composite signal derived from CISA KEV, CISA SSVC, EPSS, trickest/cve, and Nuclei templates.

Attack Surface

AV AC PR UI S C I A
AV Network
AC Low
PR None
UI None
S Unchanged
C None
I None
A High

Recommended Action

5 steps
  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.

CISA SSVC Assessment

Decision Track
Exploitation none
Automatable No
Technical Impact partial

Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.

Classification

Compliance Impact

This CVE is relevant to:

EU AI Act
Art. 15 - Accuracy, robustness and cybersecurity
ISO 42001
A.9.3 - AI system availability and resilience
NIST AI RMF
MANAGE 2.2 - Risk treatments and resilience
OWASP LLM Top 10
LLM10:2025 - Unbounded Consumption

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.

CVSS Vector

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Timeline

Published
September 16, 2022
Last Modified
November 21, 2024
First Seen
September 16, 2022

Related Vulnerabilities