CVE-2022-35941: TensorFlow: DoS via negative ksize in AvgPoolOp

HIGH
Published September 16, 2022
CISO Take

TensorFlow inference endpoints accepting user-controlled model parameters are vulnerable to remote crash via a negative ksize value in AvgPoolOp. No authentication required—any network-accessible TF Serving instance is at risk. Patch to TensorFlow 2.10.0 (or cherry-picks on 2.9.1/2.8.1/2.7.2) immediately and add positive-integer validation at API boundaries as a defense-in-depth measure.

Risk Assessment

High severity (CVSS 7.5) with zero-barrier exploitability—no auth, no user interaction, low complexity over the network. Pure availability impact with no confidentiality or integrity risk. Practical risk concentrates on organizations running TensorFlow Serving or custom inference APIs where request parameters are not sanitized before reaching kernel operations. Widely deployed framework increases blast radius across the ML ecosystem.

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 41% of all CVEs
Exploitation Status
No known exploitation
Sophistication
Trivial

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 cherry-pick commits on 2.9.1, 2.8.1, or 2.7.2. Commit: 3a6ac52664c6c095aa2b114e742b0aa17fdce78f.

  2. VALIDATE

    Enforce ksize > 0 at API entry points before parameters reach TensorFlow kernel execution.

  3. ISOLATE

    Run TF Serving in containers with auto-restart policies (Kubernetes restartPolicy: Always) to minimize crash-induced downtime.

  4. DETECT

    Monitor TF Serving logs and process supervisor metrics for abnormal crash/restart patterns as exploitation indicators.

  5. AUDIT

    Inventory all TF deployments exposing AvgPool-based models to external or user-controlled input.

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.6.2.5 - AI system availability and resilience
NIST AI RMF
MANAGE-2.2 - Mechanisms to sustain the value of deployed AI systems are evaluated and applied

Frequently Asked Questions

What is CVE-2022-35941?

TensorFlow inference endpoints accepting user-controlled model parameters are vulnerable to remote crash via a negative ksize value in AvgPoolOp. No authentication required—any network-accessible TF Serving instance is at risk. Patch to TensorFlow 2.10.0 (or cherry-picks on 2.9.1/2.8.1/2.7.2) immediately and add positive-integer validation at API boundaries as a defense-in-depth measure.

Is CVE-2022-35941 actively exploited?

No confirmed active exploitation of CVE-2022-35941 has been reported, but organizations should still patch proactively.

How to fix CVE-2022-35941?

1. PATCH: Upgrade to TensorFlow 2.10.0 or apply cherry-pick commits on 2.9.1, 2.8.1, or 2.7.2. Commit: 3a6ac52664c6c095aa2b114e742b0aa17fdce78f. 2. VALIDATE: Enforce ksize > 0 at API entry points before parameters reach TensorFlow kernel execution. 3. ISOLATE: Run TF Serving in containers with auto-restart policies (Kubernetes restartPolicy: Always) to minimize crash-induced downtime. 4. DETECT: Monitor TF Serving logs and process supervisor metrics for abnormal crash/restart patterns as exploitation indicators. 5. AUDIT: Inventory all TF deployments exposing AvgPool-based models to external or user-controlled input.

What systems are affected by CVE-2022-35941?

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

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

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

Technical Details

NVD Description

TensorFlow is an open source platform for machine learning. The `AvgPoolOp` function takes an argument `ksize` that must be positive but is not checked. A negative `ksize` can trigger a `CHECK` failure and crash the program. 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 to this issue.

Exploitation Scenario

An attacker identifies a model serving endpoint powered by TensorFlow (via architecture fingerprinting or public documentation). They craft a REST API request to TF Serving with a negative ksize value (e.g., ksize=-1) targeting a model with an AvgPool layer. The CHECK assertion fires immediately, crashing the process. With no rate limiting or input validation, the attacker repeatedly crashes the service—causing sustained availability disruption to AI-powered applications such as fraud detection, recommendation engines, or computer vision pipelines—with zero credentials required.

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