CVE-2022-35982: TensorFlow: DoS via invalid SparseBincount input

HIGH PoC AVAILABLE
Published September 16, 2022
CISO Take

TensorFlow's SparseBincount op crashes with a segfault when given malformed sparse tensor inputs, enabling unauthenticated remote DoS against any internet-exposed TF inference endpoint. Patch to TF 2.10.0, 2.9.1, 2.8.1, or 2.7.2 immediately. If patching is not immediately feasible, isolate TF serving endpoints behind authenticated API gateways and validate sparse tensor dimension consistency before forwarding requests to the model.

Risk Assessment

High availability risk for organizations exposing TensorFlow inference APIs over the network. CVSS 7.5 reflects a network-exploitable, zero-auth, low-complexity exploit path with full availability impact. No confidentiality or integrity risk. Exploitability is trivial — crafting a malformed sparse tensor requires minimal ML knowledge. Risk amplifies in multi-tenant inference infrastructure or SLA-bound production ML services where a single crashing process disrupts multiple downstream consumers.

Affected Systems

Package Ecosystem Vulnerable Range Patched
tensorflow pip No patch
195.0K OpenSSF 7.2 3.7K dependents Pushed today 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.1%
chance of exploitation in 30 days
Higher than 20% 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

1 step
  1. 1) Patch: Upgrade to TensorFlow 2.10.0, 2.9.1, 2.8.1, or 2.7.2 (commit 40adbe4dd15b582b0210dfbf40c243a62f5119fa). 2) Defense-in-depth: Place all TF inference endpoints behind authenticated API gateways to eliminate the unauthenticated attack surface. 3) Input validation: Enforce that sparse tensor indices count matches values count and is consistent with dense_shape before forwarding to the model. 4) Detection: Monitor TF serving processes for unexpected crashes (SIGABRT/SIGSEGV); alert on repeated process restarts from the same source IP. 5) Rate limiting: Apply per-client request rate limits on inference endpoints to reduce DoS amplification potential.

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
Article 9 - Risk Management System
ISO 42001
A.9.3 - AI System Availability and Resilience
NIST AI RMF
MANAGE 2.2 - Mechanisms to Respond to Vulnerabilities Affecting AI Systems
OWASP LLM Top 10
LLM04 - Model Denial of Service

Frequently Asked Questions

What is CVE-2022-35982?

TensorFlow's SparseBincount op crashes with a segfault when given malformed sparse tensor inputs, enabling unauthenticated remote DoS against any internet-exposed TF inference endpoint. Patch to TF 2.10.0, 2.9.1, 2.8.1, or 2.7.2 immediately. If patching is not immediately feasible, isolate TF serving endpoints behind authenticated API gateways and validate sparse tensor dimension consistency before forwarding requests to the model.

Is CVE-2022-35982 actively exploited?

Proof-of-concept exploit code is publicly available for CVE-2022-35982, increasing the risk of exploitation.

How to fix CVE-2022-35982?

1) Patch: Upgrade to TensorFlow 2.10.0, 2.9.1, 2.8.1, or 2.7.2 (commit 40adbe4dd15b582b0210dfbf40c243a62f5119fa). 2) Defense-in-depth: Place all TF inference endpoints behind authenticated API gateways to eliminate the unauthenticated attack surface. 3) Input validation: Enforce that sparse tensor indices count matches values count and is consistent with dense_shape before forwarding to the model. 4) Detection: Monitor TF serving processes for unexpected crashes (SIGABRT/SIGSEGV); alert on repeated process restarts from the same source IP. 5) Rate limiting: Apply per-client request rate limits on inference endpoints to reduce DoS amplification potential.

What systems are affected by CVE-2022-35982?

This vulnerability affects the following AI/ML architecture patterns: model serving, inference APIs, recommendation systems, NLP inference pipelines, multi-tenant ML platforms.

What is the CVSS score for CVE-2022-35982?

CVE-2022-35982 has a CVSS v3.1 base score of 7.5 (HIGH). The EPSS exploitation probability is 0.06%.

Technical Details

NVD Description

TensorFlow is an open source platform for machine learning. If `SparseBincount` is given inputs for `indices`, `values`, and `dense_shape` that do not make a valid sparse tensor, it results in a segfault that can be used to trigger a denial of service attack. We have patched the issue in GitHub commit 40adbe4dd15b582b0210dfbf40c243a62f5119fa. 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 adversary identifies a public-facing TensorFlow Serving endpoint via Shodan or direct network reconnaissance running a recommendation or NLP model that internally uses SparseBincount. They craft a gRPC or REST inference request with a SparseBincount op input where the indices tensor length does not match the values tensor length, or where dense_shape is inconsistent with the provided indices. Sending this single malformed request triggers a segfault in the TF serving process, taking down the inference service. The attacker loops this request to maintain a persistent DoS with minimal resources, cycling source IPs to bypass naive rate limits. No ML expertise is required beyond knowing the op name and tensor input structure.

Weaknesses (CWE)

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