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.

What is the risk?

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.

What systems are affected?

Package Ecosystem Vulnerable Range Patched
TensorFlow pip No patch
195.8K OpenSSF 7.1 3.7K dependents Pushed 2d ago 4% patched ~1372d to patch Full package profile →

Do you use TensorFlow? You're affected.

How severe is it?

CVSS 3.1
7.5 / 10
EPSS
0.5%
chance of exploitation in 30 days
Higher than 41% 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, VulnCheck KEV, CISA SSVC, EPSS, Metasploit, Exploit-DB, trickest/cve, Nuclei templates, and inthewild.io exploitation reports.

What is the 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

What should I do?

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.

What does CISA's SSVC say?

Decision Track
Exploitation none
Automatable No
Technical Impact partial

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:

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.53%.

What is the AI security impact?

Affected AI Architectures

model servingtraining pipelinesinference APIs

MITRE ATLAS Techniques

AML.T0029 Denial of AI Service
AML.T0049 Exploit Public-Facing Application

Compliance Controls Affected

EU AI Act: Art. 15
ISO 42001: A.9.3
NIST AI RMF: MANAGE 2.2
OWASP LLM Top 10: LLM10:2025

What are the technical details?

Original Advisory

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)

CWE-617 — Reachable Assertion: The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.

  • [Implementation] Make sensitive open/close operation non reachable by directly user-controlled data (e.g. open/close resources)
  • [Implementation] Perform input validation on user data.

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

Timeline

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

Related Vulnerabilities