Miggo Logo

CVE-2021-29590: Heap OOB read in TFLite's implementation of `Minimum` or `Maximum`

2.5

CVSS Score
3.1

Basic Information

EPSS Score
0.0259%
Published
5/21/2021
Updated
11/13/2024
KEV Status
No
Technology
TechnologyPython

Technical Details

CVSS Vector
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:L
Package NameEcosystemVulnerable VersionsFirst Patched Version
tensorflowpip< 2.1.42.1.4
tensorflowpip>= 2.2.0, < 2.2.32.2.3
tensorflowpip>= 2.3.0, < 2.3.32.3.3
tensorflowpip>= 2.4.0, < 2.4.22.4.2
tensorflow-cpupip>= 0, < 2.1.42.1.4
tensorflow-cpupip>= 2.2.0, < 2.2.32.2.3
tensorflow-cpupip>= 2.3.0, < 2.3.32.3.3
tensorflow-cpupip>= 2.4.0, < 2.4.22.4.2
tensorflow-gpupip>= 0, < 2.1.42.1.4
tensorflow-gpupip>= 2.2.0, < 2.2.32.2.3
tensorflow-gpupip>= 2.3.0, < 2.3.32.3.3
tensorflow-gpupip>= 2.4.0, < 2.4.22.4.2

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from the broadcasting implementation in MaximumMinimumBroadcastSlow, which handles element-wise operations for Minimum/Maximum operators. The lambda function directly accesses input tensors using potentially out-of-bounds indices when inputs are empty, as shown in the provided code snippet. The patch adds input validation at the operator entry point (Eval function in maximum_minimum.cc), but the core vulnerability exists in this reference implementation's indexing logic.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

### Imp**t T** impl*m*nt*tions o* t** `Minimum` *n* `M*ximum` T*Lit* op*r*tors **n ** us** to r*** **t* outsi** o* *oun*s o* ***p *llo**t** o*j**ts, i* *ny o* t** two input t*nsor *r*um*nts *r* *mpty. T*is is ****us* [t** *ro****stin* impl*m*nt*tion

Reasoning

T** vuln*r**ility st*ms *rom t** *ro****stin* impl*m*nt*tion in M*ximumMinimum*ro****stSlow, w*i** **n*l*s *l*m*nt-wis* op*r*tions *or Minimum/M*ximum op*r*tors. T** l*m*** `*un*tion` *ir**tly ****ss*s input t*nsors usin* pot*nti*lly out-o*-*oun*s in