LiveActive security incident?Get immediate response
CVE Record

CVE-2021-37652: Use after free in boosted trees creation in TensorFlow

TensorFlow is an end-to-end open source platform for machine learning. In affected versions the implementation for `tf.raw_ops.BoostedTreesCreateEnsemble` can result in a use after free error if an attacker supplies specially crafted arguments. The [implementation](https://github.com/tensorflow/tensorflow/blob/f24faa153ad31a4b51578f8181d3aaab77a1ddeb/tensorflow/core/kernels/boosted_trees/resource_ops.cc#L55) uses a reference counted resource and decrements the refcount if the initialization fails, as it should. However, when the code was written, the resource was represented as a naked pointer but later refactoring has changed it to be a smart pointer. Thus, when the pointer leaves the scope, a subsequent `free`-ing of the resource occurs, but this fails to take into account that the refcount has already reached 0, thus the resource has been already freed. During this double-free process, members of the resource object are accessed for cleanup but they are invalid as the entire resource has been freed. We have patched the issue in GitHub commit 5ecec9c6fbdbc6be03295685190a45e7eee726ab. 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.8Not KEV-listedUpdated
Glexia's TakeAutomated analysishigh

Security readout for executives and security teams

Plain-English summary

TensorFlow has a high-severity memory-safety flaw in boosted-tree ensemble creation. Crafted inputs can trigger use-after-free behavior during failed initialization. Business urgency is highest where affected TensorFlow runtimes execute untrusted user code, notebooks, models, or inputs.

Executive priority

Prioritize remediation for shared or user-accessible ML systems. For isolated internal workloads with trusted inputs, schedule normal high-severity patching. No active exploitation is documented in the provided sources.

Technical view

CVE-2021-37652 affects tf.raw_ops.BoostedTreesCreateEnsemble. A refcounted resource became a smart pointer after refactoring; on initialization failure, cleanup can decrement the refcount and later free the same resource again, causing invalid member access. CVSS 3.1 is 7.8 with local attack vector and low privileges required.

Likely exposure

Exposure is likely limited to environments running affected TensorFlow versions: >=2.5.0 <2.5.1, >=2.4.0 <2.4.3, or <2.3.4. Risk increases in shared ML platforms, notebooks, CI jobs, or services where users can influence TensorFlow operation arguments.

Exploitation context

The provided sources do not show CISA KEV listing or active exploitation. The CVSS vector indicates local access, low privileges, no user interaction, and potential high confidentiality, integrity, and availability impact.

Researcher notes

This is CWE-416 use-after-free caused by resource lifetime handling after a smart-pointer refactor. Validate exposure by TensorFlow version and reachable use of the affected raw op. The sources do not document a remote vector, exploit availability, or non-upgrade workaround.

Mitigation direction

  • Upgrade to TensorFlow 2.6.0 or patched supported releases 2.5.1, 2.4.3, or 2.3.4.
  • Apply commit 5ecec9c6fbdbc6be03295685190a45e7eee726ab if maintaining a TensorFlow fork.
  • Restrict untrusted users from executing arbitrary TensorFlow operations in shared runtimes.
  • Isolate ML workloads with least privilege and separate tenants where practical.
  • Check TensorFlow vendor guidance before deploying alternative mitigations.

Validation and detection

  • Inventory TensorFlow package versions across production, research, CI, and notebook environments.
  • Flag versions in the affected ranges listed by the CVE source bundle.
  • Review code and notebooks for boosted-tree or tf.raw_ops.BoostedTreesCreateEnsemble usage.
  • Confirm upgraded environments report patched TensorFlow versions.
  • Assess whether untrusted users can influence TensorFlow operation arguments.
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-416: 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-37652 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.8 (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: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.8CVSS 3.1HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H1.85.9Primary CVE score

Vulnerability scoring details

Base CVSS 3.1 score

7.8High
CVSS 3.1 vector shape for CVE-2021-37652Attack 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: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-416 · source CWE mapping

Use After Free

Use After Free represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.