CVE-2022-35986: TensorFlow: RaggedBincount DoS crashes inference server
HIGH PoC AVAILABLEAny TensorFlow inference endpoint processing ragged tensor inputs is vulnerable to unauthenticated remote crash via a single malformed request — no auth, no complexity. Patch to TF 2.10.0/2.9.1/2.8.1/2.7.2 immediately and put API gateway input validation in front of TF Serving. Internal-only training workloads are lower priority but still exposed if reachable by untrusted users.
What is the risk?
CVSS 7.5 HIGH with AV:N/AC:L/PR:N/UI:N is a reliable, trivial unauthenticated DoS. Impact is limited to availability — no data exfiltration or code execution path. Risk is highest for organizations exposing TensorFlow Serving or custom TF inference APIs on untrusted networks without input validation or API gateway protection. Without HA/auto-restart, a single request takes the inference service offline.
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 TF 2.10.0, 2.9.1, 2.8.1, or 2.7.2 — no workaround exists per vendor advisory.
-
INPUT VALIDATION
Add API gateway or application-layer checks to reject empty or malformed tensor shapes before they reach TF ops.
-
PROCESS ISOLATION
Run TF Serving in containerized processes with auto-restart policies (systemd restart=always, k8s liveness probe) to minimize availability impact.
-
NETWORK CONTROLS
Restrict TF Serving ports (8500/8501) to internal networks; never expose directly to internet.
-
DETECTION
Alert on unexpected TF Serving process restarts or segfaults in application logs — a pattern of crashes correlating with specific request origins indicates active exploitation.
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-35986?
Any TensorFlow inference endpoint processing ragged tensor inputs is vulnerable to unauthenticated remote crash via a single malformed request — no auth, no complexity. Patch to TF 2.10.0/2.9.1/2.8.1/2.7.2 immediately and put API gateway input validation in front of TF Serving. Internal-only training workloads are lower priority but still exposed if reachable by untrusted users.
Is CVE-2022-35986 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2022-35986, increasing the risk of exploitation.
How to fix CVE-2022-35986?
1. PATCH: Upgrade to TF 2.10.0, 2.9.1, 2.8.1, or 2.7.2 — no workaround exists per vendor advisory. 2. INPUT VALIDATION: Add API gateway or application-layer checks to reject empty or malformed tensor shapes before they reach TF ops. 3. PROCESS ISOLATION: Run TF Serving in containerized processes with auto-restart policies (systemd restart=always, k8s liveness probe) to minimize availability impact. 4. NETWORK CONTROLS: Restrict TF Serving ports (8500/8501) to internal networks; never expose directly to internet. 5. DETECTION: Alert on unexpected TF Serving process restarts or segfaults in application logs — a pattern of crashes correlating with specific request origins indicates active exploitation.
What systems are affected by CVE-2022-35986?
This vulnerability affects the following AI/ML architecture patterns: model serving, training pipelines, NLP preprocessing pipelines.
What is the CVSS score for CVE-2022-35986?
CVE-2022-35986 has a CVSS v3.1 base score of 7.5 (HIGH). The EPSS exploitation probability is 0.40%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0029 Denial of AI Service AML.T0040 AI Model Inference API Access 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. If `RaggedBincount` is given an empty input tensor `splits`, it results in a segfault that can be used to trigger a denial of service attack. We have patched the issue in GitHub commit 7a4591fd4f065f4fa903593bc39b2f79530a74b8. 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
Adversary identifies a public-facing NLP classification API built on TensorFlow Serving. Via passive recon (job postings, API error messages, model metadata endpoints), confirms TF backend. Sends a crafted gRPC or REST inference request containing a RaggedBincount op with an empty splits tensor — this is a trivial payload requiring no specialized ML knowledge. The TF Serving process segfaults and crashes. In a single-replica deployment, the AI service is fully offline. The attacker loops the request to prevent recovery if auto-restart is in place. No credentials, no prior access, no user interaction required.
Weaknesses (CWE)
CWE-20 — Improper Input Validation: The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.
- [Architecture and Design] Consider using language-theoretic security (LangSec) techniques that characterize inputs using a formal language and build "recognizers" for that language. This effectively requires parsing to be a distinct layer that effectively enforces a boundary between raw input and internal data representations, instead of allowing parser code to be scattered throughout the program, where it could be subject to errors or inconsistencies that create weaknesses. [REF-1109] [REF-1110] [REF-1111]
- [Architecture and Design] Use an input validation framework such as Struts or the OWASP ESAPI Validation API. Note that using a framework does not automatically address all input validation problems; be mindful of weaknesses that could arise from misusing the framework itself (CWE-1173).
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
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