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.
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 |
Do you use tensorflow? You're affected.
Severity & Risk
Attack Surface
Recommended Action
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.
CISA SSVC Assessment
Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.
Classification
Compliance Impact
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.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 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
AI Threat Alert