LiveActive security incident?Get immediate response
CVE Record

CVE-2021-37654: Heap OOB and CHECK fail in `ResourceGather` in TensorFlow

TensorFlow is an end-to-end open source platform for machine learning. In affected versions an attacker can trigger a crash via a `CHECK`-fail in debug builds of TensorFlow using `tf.raw_ops.ResourceGather` or a read from outside the bounds of heap allocated data in the same API in a release build. The [implementation](https://github.com/tensorflow/tensorflow/blob/f24faa153ad31a4b51578f8181d3aaab77a1ddeb/tensorflow/core/kernels/resource_variable_ops.cc#L660-L668) does not check that the `batch_dims` value that the user supplies is less than the rank of the input tensor. Since the implementation uses several for loops over the dimensions of `tensor`, this results in reading data from outside the bounds of heap allocated buffer backing the tensor. We have patched the issue in GitHub commit bc9c546ce7015c57c2f15c168b3d9201de679a1d. 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.

HighCVSS 7.3Not KEV-listedUpdated
Glexia's TakeAutomated analysishigh

Security readout for executives and security teams

Plain-English summary

CVE-2021-37654 is a TensorFlow bug where malformed use of ResourceGather can crash debug builds or read memory outside an allocated heap buffer in release builds. The main business concern is tenant or user-controlled ML workloads causing service disruption or potential data exposure on affected TensorFlow versions.

Executive priority

Treat as a high-priority dependency update for shared or user-extensible ML environments. Single-user, tightly controlled deployments are lower urgency, but affected TensorFlow versions should still be upgraded through normal patch management.

Technical view

TensorFlow ResourceGather failed to verify that user-supplied batch_dims is less than the input tensor rank. Looping over tensor dimensions can trigger a debug CHECK failure or CWE-125 heap out-of-bounds read in release builds. CVSS 3.1 is 7.3: local attack vector, low complexity, low privileges, no user interaction.

Likely exposure

Exposure is most likely in systems running affected TensorFlow versions where users can execute TensorFlow operations or influence ResourceGather parameters, such as notebooks, shared ML platforms, training jobs, or model-serving pipelines with untrusted inputs.

Exploitation context

The source bundle does not show KEV listing or active exploitation evidence. The CVSS vector indicates local access with low privileges is required. Risk is higher in multi-user ML environments because one user-controlled workload may affect process availability or memory confidentiality.

Researcher notes

Evidence comes from the CVE record and TensorFlow advisory. The fix adds validation for ResourceGather batch_dims behavior. Do not assume remote exploitation or public weaponization from this bundle; the provided data supports local, low-privilege exploitation characteristics only.

Mitigation direction

  • Upgrade TensorFlow to 2.6.0 or a patched supported branch version.
  • Use TensorFlow 2.5.1, 2.4.3, or 2.3.4 where those branches apply.
  • Review the TensorFlow advisory and fix commit for exact vendor guidance.
  • Restrict untrusted users from running arbitrary TensorFlow workloads until patched.
  • Isolate shared ML jobs to limit cross-tenant impact from crashes or memory reads.

Validation and detection

  • Inventory deployed TensorFlow versions in applications, notebooks, containers, and training images.
  • Flag versions >=2.5.0 <2.5.1, >=2.4.0 <2.4.3, and <2.3.4.
  • Search code and pipelines for tf.raw_ops.ResourceGather usage or user-controlled gather parameters.
  • Confirm patched versions are present after rebuilds and redeployments.
  • Review application logs for unexplained TensorFlow crashes around ResourceGather.
Prepared
Confidence
high
Sources
4

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cwe · low confidence lookup

CWE-125: Exact CWE lookup

Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2021-37654 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
High
CVSS
7.3 (3.1)
Known Exploited
No
Published

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

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

1CVSS vectors
0Timeline events
0ADP providers
3Source links

CVSS vector scores

1 official score

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
7.3CVSS 3.1HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:H1.85.5Primary CVE score

Vulnerability scoring details

Base CVSS 3.1 score

7.3High
CVSS 3.1 vector shape for CVE-2021-37654Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

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

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Privileges Required
NoneLowHigh
User Interaction
NoneRequired
Scope
ChangedUnchanged
Confidentiality Impact
HighLowNone
Integrity Impact
HighLowNone
Availability Impact
HighLowNone
Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
tensorflowtensorflow>= 2.5.0, < 2.5.1, >= 2.4.0, < 2.4.3, < 2.3.4Listed
Weakness

CWE details

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.

CWE-125 · source CWE mapping

Out-of-bounds Read

Out-of-bounds Read represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.