CVE-2022-35968: TensorFlow: DoS via AvgPoolGrad shape validation failure
HIGHPoC 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 stepsPatch: 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.48%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0010.001AI SoftwareAML.T0029Denial of AI ServiceAML.T0049Exploit Public-Facing ApplicationCompliance 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] 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:HReferences
Timeline
Related Vulnerabilities
CVE-2026-189489.9Feast: insecure UDF deserialization enables RCE
Same package: tensorflowCVE-2020-151969.9TensorFlow: heap OOB read in sparse/ragged count ops
Same package: tensorflowCVE-2020-152059.8TensorFlow: heap overflow in StringNGrams, ASLR bypass
Same package: tensorflowCVE-2019-167789.8TensorFlow: heap overflow in UnsortedSegmentSum op
Same package: tensorflowCVE-2020-152089.8TFLite: OOB read/write via tensor dimension mismatch
Same package: tensorflow