CVE-2022-35968: TensorFlow: DoS via AvgPoolGrad shape validation failure

HIGHPoC AVAILABLE
Published September 16, 2022
CISO Take

Unauthenticated remote attackers can crash TensorFlow inference services by sending malformed input to any model using average pooling—CNNs, image classifiers, ResNets. No credentials or ML expertise required, just a crafted tensor with invalid shape. Patch to TF 2.10.0 (or 2.9.1/2.8.1/2.7.2 for supported branches) immediately and add input shape validation at your API boundary as defense-in-depth.

What is the risk?

Operationally significant for organizations exposing TensorFlow serving endpoints publicly. CVSS 7.5 accurately reflects the low-barrier network attack with guaranteed availability impact—AV:N/AC:L/PR:N/UI:N leaves no friction for an attacker. No privilege escalation or data exfiltration risk, but repeated triggering of the CHECK failure causes process crashes with no workaround short of patching. Risk is highest for image-processing pipelines and CNN-based inference APIs reachable from untrusted networks.

What systems are affected?

PackageEcosystemVulnerable RangePatched
TensorFlowpip—No patch
201.3KOpenSSF 7.63.4K dependentsPushed 5d ago4% patched~1372d to patchFull 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?

AVACPRUISCIA
AVNetwork
ACLow
PRNone
UINone
SUnchanged
CNone
INone
AHigh

What should I do?

5 steps
  1. Patch: Upgrade to TensorFlow 2.10.0, or cherrypick to 2.9.1/2.8.1/2.7.2 for in-range versions.

  2. Input validation: Enforce strict tensor shape checking at the API boundary before data reaches TF operations—reject requests with shapes inconsistent with your model's expected input.

  3. Process isolation: Run TF Serving in isolated containers with auto-restart policies to minimize downtime from crashes.

  4. Rate limiting: Apply rate limiting and anomaly detection on inference endpoints to slow repeated DoS attempts.

  5. Detection: Alert on unexpected TF process crashes or log lines containing CHECK failure traces from AvgPoolGrad.

What does CISA's SSVC say?

DecisionTrack
Exploitationnone
AutomatableNo
Technical Impactpartial

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
Article 15-Accuracy, Robustness and Cybersecurity
ISO 42001
A.6.2.6-AI System Availability and Resilience
NIST AI RMF
GOVERN 6.1-Policies and Procedures for AI Risk GovernanceMANAGE 2.4-AI Risk Treatment and Response

Frequently Asked Questions

What is CVE-2022-35968?

Unauthenticated remote attackers can crash TensorFlow inference services by sending malformed input to any model using average pooling—CNNs, image classifiers, ResNets. No credentials or ML expertise required, just a crafted tensor with invalid shape. Patch to TF 2.10.0 (or 2.9.1/2.8.1/2.7.2 for supported branches) immediately and add input shape validation at your API boundary as defense-in-depth.

Is CVE-2022-35968 actively exploited?

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

How to fix CVE-2022-35968?

1. Patch: Upgrade to TensorFlow 2.10.0, or cherrypick to 2.9.1/2.8.1/2.7.2 for in-range versions. 2. Input validation: Enforce strict tensor shape checking at the API boundary before data reaches TF operations—reject requests with shapes inconsistent with your model's expected input. 3. Process isolation: Run TF Serving in isolated containers with auto-restart policies to minimize downtime from crashes. 4. Rate limiting: Apply rate limiting and anomaly detection on inference endpoints to slow repeated DoS attempts. 5. Detection: Alert on unexpected TF process crashes or log lines containing CHECK failure traces from AvgPoolGrad.

What systems are affected by CVE-2022-35968?

This vulnerability affects the following AI/ML architecture patterns: model serving, inference APIs, training pipelines.

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

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

What is the AI security impact?

Affected AI Architectures

model servinginference APIstraining pipelines

MITRE ATLAS Techniques

AML.T0010.001AI Software
AML.T0029Denial of AI Service
AML.T0049Exploit Public-Facing Application

Compliance Controls Affected

EU AI Act: Article 15
ISO 42001: A.6.2.6
NIST AI RMF: GOVERN 6.1, MANAGE 2.4

What are the technical details?

Original Advisory

TensorFlow is an open source platform for machine learning. The implementation of `AvgPoolGrad` does not fully validate the input `orig_input_shape`. This results in a `CHECK` failure which can be used to trigger a denial of service attack. We have patched the issue in GitHub commit 3a6ac52664c6c095aa2b114e742b0aa17fdce78f. 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 publicly accessible TensorFlow Serving endpoint through passive reconnaissance or active scanning. Using the model's known architecture or through probing responses, they determine the endpoint uses a CNN with average pooling. They craft an inference request with an invalid orig_input_shape tensor—mismatched dimensions, zero-length axes, or values inconsistent with the preceding pooling layer—that bypasses API-level checks and reaches AvgPoolGrad. The reachable assertion fires, the TF Serving process crashes, and the inference API becomes unavailable. Automated to repeat every few seconds, this produces sustained DoS against the ML inference service with no authentication and negligible cost to the attacker.

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] If the assertion statement is required (e.g., for security or reliability), change the invoking code to avoid the conditions that trigger the assertion.
  • [Implementation] Consider changing the assertion to some other less "fatal" error. This might not be easy to implement, since other code may be needed to handle the error.

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