CVE-2022-35937: TensorFlow: GatherNd OOB read crashes inference servers

CRITICAL
Published September 16, 2022
CISO Take

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.

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
195.0K OpenSSF 7.2 3.7K dependents Pushed 6d ago 4% patched ~1372d to patch Full package profile →

Do you use tensorflow? You're affected.

Severity & Risk

CVSS 3.1
9.1 / 10
EPSS
0.1%
chance of exploitation in 30 days
Higher than 31% of all CVEs
Exploitation Status
No known exploitation
Sophistication
Moderate

Attack Surface

AV AC PR UI S C I A
AV Network
AC Low
PR None
UI None
S Unchanged
C High
I None
A High

Recommended Action

5 steps
  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.

CISA SSVC Assessment

Decision Track
Exploitation none
Automatable No
Technical Impact partial

Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.

Classification

Compliance Impact

This CVE is relevant to:

EU AI Act
Article 15 - Accuracy, robustness and cybersecurity
ISO 42001
6.1.2 - AI risk assessment 8.4 - AI system lifecycle management
NIST AI RMF
GOVERN 1.1 - Policies and accountability for AI risk MANAGE 2.2 - AI risk treatment and response
OWASP LLM Top 10
LLM03:2025 - Supply Chain Vulnerabilities

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

Timeline

Published
September 16, 2022
Last Modified
November 21, 2024
First Seen
September 16, 2022

Related Vulnerabilities