LiveActive security incident?Get immediate response
CVE Record

CVE-2021-37685: Heap OOB in TensorFlow Lite

TensorFlow is an end-to-end open source platform for machine learning. In affected versions TFLite's [`expand_dims.cc`](https://github.com/tensorflow/tensorflow/blob/149562d49faa709ea80df1d99fc41d005b81082a/tensorflow/lite/kernels/expand_dims.cc#L36-L50) contains a vulnerability which allows reading one element outside of bounds of heap allocated data. If `axis` is a large negative value (e.g., `-100000`), then after the first `if` it would still be negative. The check following the `if` statement will pass and the `for` loop would read one element before the start of `input_dims.data` (when `i = 0`). We have patched the issue in GitHub commit d94ffe08a65400f898241c0374e9edc6fa8ed257. 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.

MediumCVSS 5.5Not KEV-listedUpdated
Glexia's TakeAutomated analysismoderate

Security readout for executives and security teams

Plain-English summary

TensorFlow Lite has a memory read bug in affected TensorFlow versions. A local, low-privileged actor who can make affected code process malicious tensor dimensions could read heap memory outside the intended buffer. Sources do not indicate remote code execution or service disruption, but confidentiality impact is high.

Executive priority

Treat as a moderate confidentiality issue. Prioritize patching where TensorFlow Lite is embedded in distributed products or handles untrusted model content, but do not treat it as confirmed active exploitation based on current sources.

Technical view

In TFLite expand_dims.cc, a large negative axis can remain negative after normalization, pass validation, and make a loop read one element before input_dims.data. This is CWE-125 out-of-bounds read. TensorFlow fixed it in commit d94ffe08a65400f898241c0374e9edc6fa8ed257 and fixed releases.

Likely exposure

Exposure is most likely in applications, services, mobile apps, or embedded products using TensorFlow Lite from affected TensorFlow versions: >=2.5.0 <2.5.1, >=2.4.0 <2.4.3, or <2.3.4.

Exploitation context

The CVSS vector is local, low complexity, low privileges, and no user interaction, with high confidentiality impact. The provided sources do not report active exploitation, and CISA KEV status is false.

Researcher notes

Evidence supports a one-element heap out-of-bounds read in TFLite ExpandDims axis handling. Patch availability is clear. The bundle does not provide proof-of-concept details, exploitation in the wild, or product-specific downstream advisories.

Mitigation direction

  • Upgrade to TensorFlow 2.6.0 or later where feasible.
  • For supported older branches, upgrade to 2.5.1, 2.4.3, or 2.3.4.
  • Apply TensorFlow vendor guidance and the referenced fix commit where release upgrades are constrained.
  • Prioritize systems processing untrusted TFLite models or tensor metadata.

Validation and detection

  • Inventory TensorFlow and TensorFlow Lite versions across applications, containers, mobile apps, and embedded builds.
  • Confirm affected version ranges are not present in production or shipped artifacts.
  • Check SBOMs and dependency lockfiles for vulnerable TensorFlow versions.
  • Review whether any service loads externally supplied TFLite models or inputs.
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-37685 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
Medium
CVSS
5.5 (3.1)
Known Exploited
No
Published

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

Vulnerability scoring details

Base CVSS 3.1 score

5.5Medium
CVSS 3.1 vector shape for CVE-2021-37685Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/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.

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.