CVE-2022-35941: TensorFlow: DoS via negative ksize in AvgPoolOp
HIGHTensorFlow 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.
What is the risk?
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.
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| TensorFlow | pip | — | No patch |
Do you use TensorFlow? You're affected.
How severe is it?
What is the attack surface?
What should I do?
5 steps-
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.
-
VALIDATE
Enforce ksize > 0 at API entry points before parameters reach TensorFlow kernel execution.
-
ISOLATE
Run TF Serving in containers with auto-restart policies (Kubernetes restartPolicy: Always) to minimize crash-induced downtime.
-
DETECT
Monitor TF Serving logs and process supervisor metrics for abnormal crash/restart patterns as exploitation indicators.
-
AUDIT
Inventory all TF deployments exposing AvgPool-based models to external or user-controlled input.
What does CISA's SSVC say?
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:
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.54%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0029 Denial of AI Service AML.T0049 Exploit Public-Facing Application Compliance Controls Affected
What are the technical details?
Original Advisory
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)
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 References
- github.com/tensorflow/tensorflow/blob/8d72537c6abf5a44103b57b9c2e22c14f5f49698/tensorflow/core/kernels/avgpooling_op.cc 3rd Party
- github.com/tensorflow/tensorflow/commit/3a6ac52664c6c095aa2b114e742b0aa17fdce78f Patch 3rd Party
- github.com/tensorflow/tensorflow/security/advisories/GHSA-mgmh-g2v6-mqw5 Patch 3rd Party
Timeline
Related Vulnerabilities
CVE-2020-15196 9.9 TensorFlow: heap OOB read in sparse/ragged count ops
Same package: tensorflow CVE-2020-15205 9.8 TensorFlow: heap overflow in StringNGrams, ASLR bypass
Same package: tensorflow CVE-2020-15208 9.8 TFLite: OOB read/write via tensor dimension mismatch
Same package: tensorflow CVE-2019-16778 9.8 TensorFlow: heap overflow in UnsortedSegmentSum op
Same package: tensorflow CVE-2022-23587 9.8 TensorFlow: integer overflow in Grappler enables RCE
Same package: tensorflow