LiveActive security incident?Get immediate response
CVE Record

CVE-2021-37679: Heap OOB in nested `tf.map_fn` with `RaggedTensor`s in TensorFlow

TensorFlow is an end-to-end open source platform for machine learning. In affected versions it is possible to nest a `tf.map_fn` within another `tf.map_fn` call. However, if the input tensor is a `RaggedTensor` and there is no function signature provided, code assumes the output is a fully specified tensor and fills output buffer with uninitialized contents from the heap. The `t` and `z` outputs should be identical, however this is not the case. The last row of `t` contains data from the heap which can be used to leak other memory information. The bug lies in the conversion from a `Variant` tensor to a `RaggedTensor`. The [implementation](https://github.com/tensorflow/tensorflow/blob/460e000de3a83278fb00b61a16d161b1964f15f4/tensorflow/core/kernels/ragged_tensor_from_variant_op.cc#L177-L190) does not check that all inner shapes match and this results in the additional dimensions. The same implementation can result in data loss, if input tensor is tweaked. We have patched the issue in GitHub commit 4e2565483d0ffcadc719bd44893fb7f609bb5f12. 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.1Not KEV-listedUpdated
Glexia's TakeAutomated analysishigh

Security readout for executives and security teams

Plain-English summary

TensorFlow could expose leftover heap memory when nested `tf.map_fn` calls process `RaggedTensor` inputs without an explicit signature. The issue can leak data from the same process and may also cause data loss. It matters most in shared ML environments where less-trusted users can run TensorFlow code.

Executive priority

Treat as high priority for shared or multi-user ML platforms because it can expose memory from the running process. For isolated internal training jobs, urgency is lower, but affected supported versions should still be upgraded during normal patch cycles.

Technical view

CVE-2021-37679 is a CWE-125 heap out-of-bounds read in TensorFlow's Variant-to-RaggedTensor conversion. The implementation did not verify matching inner shapes, so nested `tf.map_fn` with `RaggedTensor` could populate output with uninitialized heap contents. CVSS is 7.1: local attack vector, low complexity, low privileges, no user interaction.

Likely exposure

Exposure is limited to affected TensorFlow versions: before 2.3.4, 2.4.x before 2.4.3, and 2.5.x before 2.5.1. Risk is higher where users can execute TensorFlow code in shared notebooks, training hosts, CI, or ML services.

Exploitation context

The source data does not show active exploitation, and CISA KEV is false. Exploitation requires local, low-privileged ability to run TensorFlow code that reaches the vulnerable `RaggedTensor` conversion path. The impact is process memory disclosure and possible integrity loss.

Researcher notes

The evidence names TensorFlow only. Root cause is missing inner-shape validation in `ragged_tensor_from_variant_op.cc`. The advisory describes heap content leakage and possible data loss. No public source in the bundle confirms remote exploitation, weaponized exploitation, or additional affected downstream products.

Mitigation direction

  • Upgrade TensorFlow to 2.6.0 or later where feasible.
  • For supported older branches, upgrade to 2.5.1, 2.4.3, or 2.3.4.
  • Review vendor advisory and patch commit before backporting manually.
  • Restrict less-trusted users from running arbitrary TensorFlow code on shared hosts.
  • Prefer explicit function signatures where nested `tf.map_fn` handles `RaggedTensor` inputs.

Validation and detection

  • Inventory TensorFlow package versions across notebooks, containers, training images, and services.
  • Confirm no deployed runtime remains below fixed branch versions.
  • Identify shared environments where low-privileged users can execute TensorFlow code.
  • Review ML code for nested `tf.map_fn` over `RaggedTensor` without explicit signatures.
  • Verify patched builds include TensorFlow commit `4e2565483d0ffcadc719bd44893fb7f609bb5f12`.
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-37679 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.1 (3.1)
Known Exploited
No
Published

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

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.1CVSS 3.1HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N1.85.2Primary CVE score

Vulnerability scoring details

Base CVSS 3.1 score

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

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

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.