CVE-2022-35937: TensorFlow: GatherNd OOB read crashes inference servers
CRITICALCVE-2022-35937 is a CVSS 9.1 out-of-bounds memory read in TensorFlow's GatherNd kernel, exploitable over the network with zero authentication and zero user interaction — your model serving endpoints are exposed if unpatched. Attackers can trigger a service crash (DoS) or leak adjacent process memory, potentially exposing model weights, credentials, or other in-process secrets. Patch immediately to TF 2.10.0 or cherry-picks 2.9.1/2.8.1/2.7.2; no workarounds exist.
Risk Assessment
Critical risk for organizations running TensorFlow-based model serving in internet-facing or multi-tenant environments. The CVSS 9.1 reflects a dangerous trifecta: network-reachable, no credentials needed, no user interaction required — automated exploitation is realistic. The dual confidentiality/availability impact (C:H, A:H) is especially damaging for AI pipelines: a crash halts production inference and breaks SLAs, while memory disclosure can expose proprietary model weights or downstream secrets. Not in CISA KEV, but the severity profile warrants treating it as imminent threat.
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 — commit 595a65a3e2 adds the missing bounds check in gather_nd.cc.
-
INVENTORY
Identify all services loading TF/TFLite models from external or untrusted sources.
-
ISOLATE
Run inference processes as non-root with seccomp/AppArmor profiles to limit blast radius of any memory read.
-
MONITOR
Alert on unexpected inference worker crashes, OOM events, or abnormal restart patterns that may indicate exploitation.
-
INPUT VALIDATION
Enforce strict tensor shape and size validation at model ingestion boundaries before models reach the TF runtime. No vendor workaround exists — patching is mandatory.
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-35937?
CVE-2022-35937 is a CVSS 9.1 out-of-bounds memory read in TensorFlow's GatherNd kernel, exploitable over the network with zero authentication and zero user interaction — your model serving endpoints are exposed if unpatched. Attackers can trigger a service crash (DoS) or leak adjacent process memory, potentially exposing model weights, credentials, or other in-process secrets. Patch immediately to TF 2.10.0 or cherry-picks 2.9.1/2.8.1/2.7.2; no workarounds exist.
Is CVE-2022-35937 actively exploited?
No confirmed active exploitation of CVE-2022-35937 has been reported, but organizations should still patch proactively.
How to fix CVE-2022-35937?
1. PATCH: Upgrade to TensorFlow 2.10.0, 2.9.1, 2.8.1, or 2.7.2 — commit 595a65a3e2 adds the missing bounds check in gather_nd.cc. 2. INVENTORY: Identify all services loading TF/TFLite models from external or untrusted sources. 3. ISOLATE: Run inference processes as non-root with seccomp/AppArmor profiles to limit blast radius of any memory read. 4. MONITOR: Alert on unexpected inference worker crashes, OOM events, or abnormal restart patterns that may indicate exploitation. 5. INPUT VALIDATION: Enforce strict tensor shape and size validation at model ingestion boundaries before models reach the TF runtime. No vendor workaround exists — patching is mandatory.
What systems are affected by CVE-2022-35937?
This vulnerability affects the following AI/ML architecture patterns: model serving, training pipelines, edge inference, inference APIs.
What is the CVSS score for CVE-2022-35937?
CVE-2022-35937 has a CVSS v3.1 base score of 9.1 (CRITICAL). The EPSS exploitation probability is 0.13%.
Technical Details
NVD Description
TensorFlow is an open source platform for machine learning. The `GatherNd` function takes arguments that determine the sizes of inputs and outputs. If the inputs given are greater than or equal to the sizes of the outputs, an out-of-bounds memory read is triggered. This issue has been patched in GitHub commit 595a65a3e224a0362d7e68c2213acfc2b499a196. 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 crafts a malicious TFLite model file where the GatherNd operator specifies input tensor indices larger than or equal to the output tensor dimensions. When a model serving API loads and executes this model — e.g., a public inference endpoint, an internal model registry with auto-load, or a CI/CD pipeline that evaluates contributed models — the out-of-bounds read fires. This can crash the inference worker (DoS, breaking SLA) or return raw process memory in error buffers, potentially leaking API tokens, model weights, or other in-process data. In a supply chain attack, a poisoned model published to a public registry could auto-trigger on any downstream consumer that imports and runs it.
Weaknesses (CWE)
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H References
- github.com/tensorflow/tensorflow/blob/f463040eb3997e42e60a2ffc6dc72de7ef11dbb4/tensorflow/lite/kernels/gather_nd.cc 3rd Party
- github.com/tensorflow/tensorflow/commit/595a65a3e224a0362d7e68c2213acfc2b499a196 Patch 3rd Party
- github.com/tensorflow/tensorflow/security/advisories/GHSA-pxrw-j2fv-hx3h 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
AI Threat Alert