CVE-2022-35982: TensorFlow: DoS via invalid SparseBincount input
HIGH PoC AVAILABLETensorFlow's SparseBincount op crashes with a segfault when given malformed sparse tensor inputs, enabling unauthenticated remote DoS against any internet-exposed TF inference endpoint. Patch to TF 2.10.0, 2.9.1, 2.8.1, or 2.7.2 immediately. If patching is not immediately feasible, isolate TF serving endpoints behind authenticated API gateways and validate sparse tensor dimension consistency before forwarding requests to the model.
Risk Assessment
High availability risk for organizations exposing TensorFlow inference APIs over the network. CVSS 7.5 reflects a network-exploitable, zero-auth, low-complexity exploit path with full availability impact. No confidentiality or integrity risk. Exploitability is trivial — crafting a malformed sparse tensor requires minimal ML knowledge. Risk amplifies in multi-tenant inference infrastructure or SLA-bound production ML services where a single crashing process disrupts multiple downstream consumers.
Affected Systems
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| tensorflow | pip | — | No patch |
Do you use tensorflow? You're affected.
Severity & Risk
Attack Surface
Recommended Action
1 step-
1) Patch: Upgrade to TensorFlow 2.10.0, 2.9.1, 2.8.1, or 2.7.2 (commit 40adbe4dd15b582b0210dfbf40c243a62f5119fa). 2) Defense-in-depth: Place all TF inference endpoints behind authenticated API gateways to eliminate the unauthenticated attack surface. 3) Input validation: Enforce that sparse tensor indices count matches values count and is consistent with dense_shape before forwarding to the model. 4) Detection: Monitor TF serving processes for unexpected crashes (SIGABRT/SIGSEGV); alert on repeated process restarts from the same source IP. 5) Rate limiting: Apply per-client request rate limits on inference endpoints to reduce DoS amplification potential.
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-35982?
TensorFlow's SparseBincount op crashes with a segfault when given malformed sparse tensor inputs, enabling unauthenticated remote DoS against any internet-exposed TF inference endpoint. Patch to TF 2.10.0, 2.9.1, 2.8.1, or 2.7.2 immediately. If patching is not immediately feasible, isolate TF serving endpoints behind authenticated API gateways and validate sparse tensor dimension consistency before forwarding requests to the model.
Is CVE-2022-35982 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2022-35982, increasing the risk of exploitation.
How to fix CVE-2022-35982?
1) Patch: Upgrade to TensorFlow 2.10.0, 2.9.1, 2.8.1, or 2.7.2 (commit 40adbe4dd15b582b0210dfbf40c243a62f5119fa). 2) Defense-in-depth: Place all TF inference endpoints behind authenticated API gateways to eliminate the unauthenticated attack surface. 3) Input validation: Enforce that sparse tensor indices count matches values count and is consistent with dense_shape before forwarding to the model. 4) Detection: Monitor TF serving processes for unexpected crashes (SIGABRT/SIGSEGV); alert on repeated process restarts from the same source IP. 5) Rate limiting: Apply per-client request rate limits on inference endpoints to reduce DoS amplification potential.
What systems are affected by CVE-2022-35982?
This vulnerability affects the following AI/ML architecture patterns: model serving, inference APIs, recommendation systems, NLP inference pipelines, multi-tenant ML platforms.
What is the CVSS score for CVE-2022-35982?
CVE-2022-35982 has a CVSS v3.1 base score of 7.5 (HIGH). The EPSS exploitation probability is 0.06%.
Technical Details
NVD Description
TensorFlow is an open source platform for machine learning. If `SparseBincount` is given inputs for `indices`, `values`, and `dense_shape` that do not make a valid sparse tensor, it results in a segfault that can be used to trigger a denial of service attack. We have patched the issue in GitHub commit 40adbe4dd15b582b0210dfbf40c243a62f5119fa. 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 public-facing TensorFlow Serving endpoint via Shodan or direct network reconnaissance running a recommendation or NLP model that internally uses SparseBincount. They craft a gRPC or REST inference request with a SparseBincount op input where the indices tensor length does not match the values tensor length, or where dense_shape is inconsistent with the provided indices. Sending this single malformed request triggers a segfault in the TF serving process, taking down the inference service. The attacker loops this request to maintain a persistent DoS with minimal resources, cycling source IPs to bypass naive rate limits. No ML expertise is required beyond knowing the op name and tensor input structure.
Weaknesses (CWE)
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
AI Threat Alert