CVE-2022-35968: TensorFlow: DoS via AvgPoolGrad shape validation failure
HIGH PoC AVAILABLEUnauthenticated 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?
| 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 cherrypick to 2.9.1/2.8.1/2.7.2 for in-range versions.
-
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.
-
Process isolation: Run TF Serving in isolated containers with auto-restart policies to minimize downtime from crashes.
-
Rate limiting: Apply rate limiting and anomaly detection on inference endpoints to slow repeated DoS attempts.
-
Detection: Alert on unexpected TF process crashes or log lines containing CHECK failure traces from AvgPoolGrad.
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-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.38%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0010.001 AI Software 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 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] 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/commit/3a6ac52664c6c095aa2b114e742b0aa17fdce78f Patch 3rd Party
- github.com/tensorflow/tensorflow/security/advisories/GHSA-2475-53vw-vp25 Patch 3rd Party
- github.com/ARPSyndicate/cvemon Exploit
- github.com/gclonly/im Exploit
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