Miggo Logo

CVE-2021-29535:
Heap buffer overflow in `QuantizedMul`

2.5

CVSS Score
3.1

Basic Information

EPSS Score
0.02934%
Published
5/21/2021
Updated
10/30/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< 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< 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 unvalidated tensor access in QuantizedMulOp::Compute. The original implementation assumed inputs 2-5 (min/max values) were always valid scalars and accessed their first element via .flat<float>()(0). When these tensors are empty (as shown in the PoC), this results in an out-of-bounds buffer access. The patch adds explicit scalar validation via TensorShapeUtils::IsScalar checks, confirming the root cause was missing input validation in this function.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

### Imp**t *n *tt**k*r **n **us* * ***p *u***r ov*r*low in `Qu*ntiz**Mul` *y p*ssin* in inv*li* t*r*s*ol*s *or t** qu*ntiz*tion: ```pyt*on import t*nsor*low *s t* x = t*.*onst*nt([***, ***], s**p*=[*, *], *typ*=t*.quint*) y = t*.*onst*nt([***, ***]

Reasoning

T** vuln*r**ility st*ms *rom t** unv*li**t** t*nsor ****ss in `Qu*ntiz**MulOp::*omput*`. T** ori*in*l impl*m*nt*tion *ssum** inputs *-* (min/m*x v*lu*s) w*r* *lw*ys v*li* s**l*rs *n* ****ss** t**ir *irst *l*m*nt vi* `.*l*t<*lo*t>()(*)`. W**n t**s* t*