Miggo Logo

CVE-2021-29610: Invalid validation in `QuantizeAndDequantizeV2`

3.6

CVSS Score
3.1

Basic Information

EPSS Score
0.14763%
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:L/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 OP_REQUIRES validation in the Compute method of QuantizeAndDequantizeV2Op. The condition (axis_ == -1 || axis_ < input.shape().dims()) fails to account for negative axis values < -1, allowing invalid indices. This leads to underflow when calculating normalized axis positions, enabling heap memory corruption. The patch explicitly adds a check for axis_ >= -1, confirming this function as the vulnerable point.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

### Imp**t T** v*li**tion in `t*.r*w_ops.Qu*ntiz**n***qu*ntiz*V*` *llows inv*li* v*lu*s *or `*xis` *r*um*nt: ```pyt*on import t*nsor*low *s t* input_t*nsor = t*.*onst*nt([*.*], s**p*=[*], *typ*=*lo*t) input_min = t*.*onst*nt(-**.*) input_m*x = t*.*

Reasoning

T** vuln*r**ility st*ms *rom t** OP_R*QUIR*S v*li**tion in t** *omput* m*t*o* o* Qu*ntiz**n***qu*ntiz*V*Op. T** *on*ition (*xis_ == -* || *xis_ < input.s**p*().*ims()) **ils to ***ount *or n***tiv* *xis v*lu*s < -*, *llowin* inv*li* in*i**s. T*is l**