CVE-2021-37655: TensorFlow: OOB heap read in ResourceScatterUpdate
HIGHTensorFlow versions before 2.6.0 allow any low-privileged local user to trigger an out-of-bounds heap read via malformed tensor shapes in ResourceScatterUpdate, with high confidentiality impact. Patch immediately to TF 2.6.0, 2.5.1, 2.4.3, or 2.3.4—especially on shared ML compute environments like JupyterHub or Kubeflow. No workaround exists; patching is the only remediation.
Risk Assessment
CVSS 7.3 High with local attack vector limits direct internet exposure, but the risk escalates significantly in multi-tenant ML platforms where multiple users share a single TF runtime. Low complexity and low privilege requirements mean any authenticated researcher or data scientist on a shared GPU cluster can trigger this. Confidentiality impact is rated High (C:H), meaning sensitive heap data—including model weights or in-memory credentials—could be exposed. Not in CISA KEV and no active exploitation observed, reducing urgency for air-gapped environments but not for shared SaaS ML infrastructure.
Affected Systems
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| tensorflow | pip | — | No patch |
Do you use tensorflow? You're affected.
Severity & Risk
Attack Surface
Recommended Action
1 step-
1) Upgrade TensorFlow to ≥2.6.0 or apply cherry-picked patches for supported branches (2.5.1, 2.4.3, 2.3.4). 2) Audit shared ML platforms (JupyterHub, SageMaker Studio, Vertex AI Workbench) for outdated TF versions—these are the highest-risk surfaces. 3) Enforce strict namespace and process isolation between tenant workloads on shared GPU infrastructure. 4) If patching is blocked, restrict access to tf.raw_ops namespace via OPA/policy controls in notebook environments. 5) For detection: grep codebases for tf.raw_ops.ResourceScatterUpdate usage; monitor TF process crashes or SIGSEGV signals as potential exploitation indicators.
Classification
Compliance Impact
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2021-37655?
TensorFlow versions before 2.6.0 allow any low-privileged local user to trigger an out-of-bounds heap read via malformed tensor shapes in ResourceScatterUpdate, with high confidentiality impact. Patch immediately to TF 2.6.0, 2.5.1, 2.4.3, or 2.3.4—especially on shared ML compute environments like JupyterHub or Kubeflow. No workaround exists; patching is the only remediation.
Is CVE-2021-37655 actively exploited?
No confirmed active exploitation of CVE-2021-37655 has been reported, but organizations should still patch proactively.
How to fix CVE-2021-37655?
1) Upgrade TensorFlow to ≥2.6.0 or apply cherry-picked patches for supported branches (2.5.1, 2.4.3, 2.3.4). 2) Audit shared ML platforms (JupyterHub, SageMaker Studio, Vertex AI Workbench) for outdated TF versions—these are the highest-risk surfaces. 3) Enforce strict namespace and process isolation between tenant workloads on shared GPU infrastructure. 4) If patching is blocked, restrict access to tf.raw_ops namespace via OPA/policy controls in notebook environments. 5) For detection: grep codebases for tf.raw_ops.ResourceScatterUpdate usage; monitor TF process crashes or SIGSEGV signals as potential exploitation indicators.
What systems are affected by CVE-2021-37655?
This vulnerability affects the following AI/ML architecture patterns: training pipelines, model serving, notebook environments, shared ML compute.
What is the CVSS score for CVE-2021-37655?
CVE-2021-37655 has a CVSS v3.1 base score of 7.3 (HIGH). The EPSS exploitation probability is 0.04%.
Technical Details
NVD Description
TensorFlow is an end-to-end open source platform for machine learning. In affected versions an attacker can trigger a read from outside of bounds of heap allocated data by sending invalid arguments to `tf.raw_ops.ResourceScatterUpdate`. The [implementation](https://github.com/tensorflow/tensorflow/blob/f24faa153ad31a4b51578f8181d3aaab77a1ddeb/tensorflow/core/kernels/resource_variable_ops.cc#L919-L923) has an incomplete validation of the relationship between the shapes of `indices` and `updates`: instead of checking that the shape of `indices` is a prefix of the shape of `updates` (so that broadcasting can happen), code only checks that the number of elements in these two tensors are in a divisibility relationship. We have patched the issue in GitHub commit 01cff3f986259d661103412a20745928c727326f. The fix will be included in TensorFlow 2.6.0. We will also cherrypick this commit on TensorFlow 2.5.1, TensorFlow 2.4.3, and TensorFlow 2.3.4, as these are also affected and still in supported range.
Exploitation Scenario
An adversary with a low-privilege account on a shared JupyterHub instance (e.g., a compromised intern account at an ML research org) opens a notebook and crafts a call to tf.raw_ops.ResourceScatterUpdate with indices and updates tensors whose total element counts have a divisibility relationship but whose shapes are incompatible for broadcasting. TensorFlow's validation passes the divisibility check and proceeds, causing the C++ kernel to read beyond the bounds of the heap-allocated updates buffer. The attacker iterates shapes to read adjacent heap regions, potentially extracting fragments of model weights, training data, or in-process API tokens cached by a co-running LLM fine-tuning job on the same host.
Weaknesses (CWE)
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:H References
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