CVE-2022-35934: TensorFlow: tf.reshape DoS via integer overflow
HIGH PoC AVAILABLEA remote, unauthenticated attacker can crash any TensorFlow serving endpoint by submitting a crafted tensor that overflows the element count in tf.reshape, triggering an assertion failure. No privileges or user interaction required — CVSS 7.5. Patch immediately to TF 2.10.0, 2.9.1, 2.8.1, or 2.7.2; prioritize internet-facing inference APIs.
Risk Assessment
High severity due to network-accessible, zero-authentication DoS with low attack complexity. While the impact is limited to availability (no data exfiltration or code execution), AI inference infrastructure is a high-value target for availability attacks — downtime of model-serving endpoints directly impacts business operations. No active exploitation reported and not in CISA KEV, reducing urgency slightly. Organizations with public-facing TensorFlow serving APIs are most exposed.
Affected Systems
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| tensorflow | pip | — | No patch |
Do you use tensorflow? You're affected.
Severity & Risk
Attack Surface
Recommended Action
5 steps-
Patch: Upgrade to TensorFlow 2.10.0, 2.9.1, 2.8.1, or 2.7.2 immediately.
-
Input validation: Add server-side bounds checks on tensor shape dimensions before passing to tf.reshape — reject inputs where the product of dimensions exceeds a safe threshold (e.g., 2^31-1 elements).
-
API gateway: Rate-limit and validate Content-Length/shape parameters at the load balancer level.
-
Isolation: Run inference workers in separate processes/containers so a crash does not take down the entire serving stack.
-
Detection: Alert on abnormal process crash rates or SIGABRT signals in TensorFlow serving processes.
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-35934?
A remote, unauthenticated attacker can crash any TensorFlow serving endpoint by submitting a crafted tensor that overflows the element count in tf.reshape, triggering an assertion failure. No privileges or user interaction required — CVSS 7.5. Patch immediately to TF 2.10.0, 2.9.1, 2.8.1, or 2.7.2; prioritize internet-facing inference APIs.
Is CVE-2022-35934 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2022-35934, increasing the risk of exploitation.
How to fix CVE-2022-35934?
1. Patch: Upgrade to TensorFlow 2.10.0, 2.9.1, 2.8.1, or 2.7.2 immediately. 2. Input validation: Add server-side bounds checks on tensor shape dimensions before passing to tf.reshape — reject inputs where the product of dimensions exceeds a safe threshold (e.g., 2^31-1 elements). 3. API gateway: Rate-limit and validate Content-Length/shape parameters at the load balancer level. 4. Isolation: Run inference workers in separate processes/containers so a crash does not take down the entire serving stack. 5. Detection: Alert on abnormal process crash rates or SIGABRT signals in TensorFlow serving processes.
What systems are affected by CVE-2022-35934?
This vulnerability affects the following AI/ML architecture patterns: model serving, inference endpoints, training pipelines, batch scoring pipelines.
What is the CVSS score for CVE-2022-35934?
CVE-2022-35934 has a CVSS v3.1 base score of 7.5 (HIGH). The EPSS exploitation probability is 0.04%.
Technical Details
NVD Description
TensorFlow is an open source platform for machine learning. The implementation of tf.reshape op in TensorFlow is vulnerable to a denial of service via CHECK-failure (assertion failure) caused by overflowing the number of elements in a tensor. This issue has been patched in GitHub commit 61f0f9b94df8c0411f0ad0ecc2fec2d3f3c33555. 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 TensorFlow Serving gRPC or REST endpoint (e.g., via Shodan or by probing known model API paths). They craft a PredictRequest with a tensor specifying a shape whose element product overflows int64, such as [2^32, 2^32]. When tf.reshape processes this input, the internal CHECK assertion fires, triggering SIGABRT and crashing the serving process. The attacker automates this in a loop to maintain continuous downtime. No ML knowledge is required — the payload is a trivially crafted numeric array.
Weaknesses (CWE)
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/61f0f9b94df8c0411f0ad0ecc2fec2d3f3c33555 Patch 3rd Party
- github.com/tensorflow/tensorflow/security/advisories/GHSA-f4w6-h4f5-wx45 Patch 3rd Party
- github.com/ARPSyndicate/cvemon Exploit
- github.com/iotdscreator/iotdscreator-dataset Exploit
- github.com/skipfuzz/skipfuzz 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
AI Threat Alert