CVE-2022-35940: TensorFlow: integer overflow in RaggedRangeOp crashes service
HIGHA remotely exploitable integer overflow in TensorFlow's RaggedRangeOp allows an unauthenticated attacker to crash any TF-based inference service by sending a crafted input with a very large float value. No authentication or privileges required — any exposed TF Serving endpoint or ML API is at risk. Patch to TF 2.10.0 (or cherrypick backports for 2.7.x–2.9.x) immediately; no workaround exists.
What is the risk?
High risk for organizations exposing TensorFlow inference endpoints to untrusted inputs. CVSS 7.5 with network vector, low complexity, no privileges, no user interaction means automated exploitation is trivial. The abort signal (not just exception) makes recovery require process restart, amplifying DoS impact. Risk is reduced if TF is deployed behind input validation layers or in air-gapped training environments, but model serving APIs are frequently internet-facing.
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?
6 steps-
PATCH
Upgrade to TensorFlow 2.10.0 or apply backport commits to 2.9.1, 2.8.1, 2.7.2.
-
VALIDATE INPUTS
Enforce strict input bounds on float parameters before they reach RaggedRangeOp; reject values exceeding int64 max (~9.2e18).
-
ISOLATE
Run TF Serving in containers with restart policies (e.g., Docker restart=always) to auto-recover from crashes.
-
MONITOR
Alert on abnormal process restarts or SIGABRT signals in TF inference services.
-
RATE LIMIT
Apply request rate limiting on ML inference APIs to reduce DoS amplification.
-
AUDIT
Inventory all TF versions in production — check pip freeze or container image manifests.
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-35940?
A remotely exploitable integer overflow in TensorFlow's RaggedRangeOp allows an unauthenticated attacker to crash any TF-based inference service by sending a crafted input with a very large float value. No authentication or privileges required — any exposed TF Serving endpoint or ML API is at risk. Patch to TF 2.10.0 (or cherrypick backports for 2.7.x–2.9.x) immediately; no workaround exists.
Is CVE-2022-35940 actively exploited?
No confirmed active exploitation of CVE-2022-35940 has been reported, but organizations should still patch proactively.
How to fix CVE-2022-35940?
1. PATCH: Upgrade to TensorFlow 2.10.0 or apply backport commits to 2.9.1, 2.8.1, 2.7.2. 2. VALIDATE INPUTS: Enforce strict input bounds on float parameters before they reach RaggedRangeOp; reject values exceeding int64 max (~9.2e18). 3. ISOLATE: Run TF Serving in containers with restart policies (e.g., Docker restart=always) to auto-recover from crashes. 4. MONITOR: Alert on abnormal process restarts or SIGABRT signals in TF inference services. 5. RATE LIMIT: Apply request rate limiting on ML inference APIs to reduce DoS amplification. 6. AUDIT: Inventory all TF versions in production — check pip freeze or container image manifests.
What systems are affected by CVE-2022-35940?
This vulnerability affects the following AI/ML architecture patterns: model serving, inference APIs, training pipelines, NLP processing pipelines.
What is the CVSS score for CVE-2022-35940?
CVE-2022-35940 has a CVSS v3.1 base score of 7.5 (HIGH). The EPSS exploitation probability is 0.52%.
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 `RaggedRangOp` function takes an argument `limits` that is eventually used to construct a `TensorShape` as an `int64`. If `limits` is a very large float, it can overflow when converted to an `int64`. This triggers an `InvalidArgument` but also throws an abort signal that crashes the program. We have patched the issue in GitHub commit 37cefa91bee4eace55715eeef43720b958a01192. 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 REST API endpoint serving a TensorFlow model that accepts ragged tensor inputs (common in NLP or recommendation systems). They craft a JSON payload specifying a RaggedRange with `limits` set to a float near 1e30 — far exceeding int64 range. When TF processes the inference request, the overflow triggers an InvalidArgument followed by SIGABRT, crashing the TF Serving process. If no restart policy is configured, the inference service goes offline. A botnet could cycle through ML API endpoints using this as a cheap, unauthenticated service disruption tool against AI platforms.
Weaknesses (CWE)
CWE-190 — Integer Overflow or Wraparound: The product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. This occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may become a very small or negative number.
- [Requirements] Ensure that all protocols are strictly defined, such that all out-of-bounds behavior can be identified simply, and require strict conformance to the protocol.
- [Requirements] Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. If possible, choose a language or compiler that performs automatic bounds checking.
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/blob/0b6b491d21d6a4eb5fbab1cca565bc1e94ca9543/tensorflow/core/kernels/ragged_range_op.cc 3rd Party
- github.com/tensorflow/tensorflow/commit/37cefa91bee4eace55715eeef43720b958a01192 Patch 3rd Party
- github.com/tensorflow/tensorflow/security/advisories/GHSA-x989-q2pq-4q5x 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