CVE-2022-35939: TensorFlow: ScatterNd OOB write enables RCE/crash

CRITICAL
Published September 16, 2022
CISO Take

Any TensorFlow deployment accepting user-controlled tensor inputs via the ScatterNd operation is vulnerable to remote code execution or crash — no authentication required, network-reachable. Patch immediately to TF 2.10.0, 2.9.1, 2.8.1, or 2.7.2; if patching is blocked, disable or sandbox any endpoint that processes untrusted ScatterNd inputs. Given CVSS 9.8 with zero prerequisites, treat unpatched internet-facing TF inference services as actively compromised until remediated.

Risk Assessment

Critical risk for organizations exposing TensorFlow inference endpoints over the network, particularly TF Serving or custom APIs that accept arbitrary tensor operations. CVSS 9.8 (AV:N/AC:L/PR:N/UI:N) means exploitation requires no skill, no credentials, and no victim interaction — a malicious client simply sends a crafted tensor with out-of-range indices. TFLite is also affected (the vulnerable code is in reference_ops.h), extending risk to edge inference deployments. No known active exploitation or CISA KEV listing as of assessment, but the trivial attack complexity makes weaponization straightforward.

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.8 / 10
EPSS
0.2%
chance of exploitation in 30 days
Higher than 46% of all CVEs
Exploitation Status
No known exploitation
Sophistication
Trivial

Attack Surface

AV AC PR UI S C I A
AV Network
AC Low
PR None
UI None
S Unchanged
C High
I High
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 b4d4b4cb019bd7). Versions before 2.7.2 are EOL and should be migrated.

  2. DETECT

    Audit all services exposing TensorFlow inference APIs; grep codebases for tf.scatter_nd, tf.tensor_scatter_nd_update, and equivalent TFLite ops.

  3. ISOLATE

    Place TF inference endpoints behind an API gateway with input schema validation to reject tensor payloads with indices outside expected bounds.

  4. MONITOR

    Enable crash/OOM alerting on TF Serving processes — repeated crashes may indicate exploitation attempts.

  5. INVENTORY

    Check all containerized ML workloads for TF version via pip show tensorflow or docker inspect; prioritize internet-facing services.

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
A.6.2.6 - AI system security
NIST AI RMF
MANAGE 2.2 - Mechanisms to sustain the value of deployed AI systems are evaluated and applied MAP 5.1 - Likelihood and magnitude of each identified impact based on impacts to individuals, groups, communities, organizations, and society

Frequently Asked Questions

What is CVE-2022-35939?

Any TensorFlow deployment accepting user-controlled tensor inputs via the ScatterNd operation is vulnerable to remote code execution or crash — no authentication required, network-reachable. Patch immediately to TF 2.10.0, 2.9.1, 2.8.1, or 2.7.2; if patching is blocked, disable or sandbox any endpoint that processes untrusted ScatterNd inputs. Given CVSS 9.8 with zero prerequisites, treat unpatched internet-facing TF inference services as actively compromised until remediated.

Is CVE-2022-35939 actively exploited?

No confirmed active exploitation of CVE-2022-35939 has been reported, but organizations should still patch proactively.

How to fix CVE-2022-35939?

1. PATCH: Upgrade to TensorFlow 2.10.0, 2.9.1, 2.8.1, or 2.7.2 (commit b4d4b4cb019bd7). Versions before 2.7.2 are EOL and should be migrated. 2. DETECT: Audit all services exposing TensorFlow inference APIs; grep codebases for tf.scatter_nd, tf.tensor_scatter_nd_update, and equivalent TFLite ops. 3. ISOLATE: Place TF inference endpoints behind an API gateway with input schema validation to reject tensor payloads with indices outside expected bounds. 4. MONITOR: Enable crash/OOM alerting on TF Serving processes — repeated crashes may indicate exploitation attempts. 5. INVENTORY: Check all containerized ML workloads for TF version via pip show tensorflow or docker inspect; prioritize internet-facing services.

What systems are affected by CVE-2022-35939?

This vulnerability affects the following AI/ML architecture patterns: model serving, training pipelines, edge inference (TFLite), ML APIs.

What is the CVSS score for CVE-2022-35939?

CVE-2022-35939 has a CVSS v3.1 base score of 9.8 (CRITICAL). The EPSS exploitation probability is 0.23%.

Technical Details

NVD Description

TensorFlow is an open source platform for machine learning. The `ScatterNd` function takes an input argument that determines the indices of of the output tensor. An input index greater than the output tensor or less than zero will either write content at the wrong index or trigger a crash. We have patched the issue in GitHub commit b4d4b4cb019bd7240a52daa4ba61e3cc814f0384. 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 targeting an organization's AI inference API sends a POST request to the TF Serving prediction endpoint with a crafted SavedModel input containing a ScatterNd operation where the indices tensor includes values exceeding the output tensor's dimensions. With no authentication barrier (or after obtaining a low-privilege API key), the malicious payload triggers an out-of-bounds write in reference_ops.h, potentially redirecting execution flow to attacker-controlled code within the TF Serving process. In a cloud-hosted ML platform scenario, this could allow lateral movement from a compromised inference container to the underlying host or shared infrastructure. Alternatively, a simpler crash-loop attack repeatedly submits malformed tensors to degrade model availability for legitimate users.

Weaknesses (CWE)

CVSS Vector

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Timeline

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

Related Vulnerabilities