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.
What is the risk?
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.
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 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.
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-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.42%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0010.001 AI Software AML.T0011.000 Unsafe AI Artifacts AML.T0029 Denial of AI Service AML.T0043 Craft Adversarial Data 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 `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)
CWE-125 — Out-of-bounds Read: The product reads data past the end, or before the beginning, of the intended buffer.
- [Implementation] Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does. When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue." Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylis
- [Architecture and Design] Use a language that provides appropriate memory abstractions.
Source: MITRE CWE corpus.
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-2019-16778 9.8 TensorFlow: heap overflow in UnsortedSegmentSum op
Same package: tensorflow CVE-2020-15208 9.8 TFLite: OOB read/write via tensor dimension mismatch
Same package: tensorflow CVE-2022-23587 9.8 TensorFlow: integer overflow in Grappler enables RCE
Same package: tensorflow