Miggo Logo

CVE-2021-29580: Undefined behavior and `CHECK`-fail in `FractionalMaxPoolGrad`

2.5

CVSS Score
3.1

Basic Information

EPSS Score
0.01803%
Published
5/21/2021
Updated
11/1/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 directly from the FractionalMaxPoolGradOp's Compute() function implementation, which lacked essential validation checks as shown in the commit diff. The patch adds OP_REQUIRES validations for tensor dimensions and non-empty status, confirming these checks were missing in the vulnerable versions. The function's role in processing gradient calculations without input validation matches both described attack scenarios (empty tensors and rank mismatch).

Vulnerable functions

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

WAF Protection Rules

WAF Rule

### Imp**t T** impl*m*nt*tion o* `t*.r*w_ops.*r**tion*lM*xPool*r**` tri***rs *n un***in** ****vior i* on* o* t** input t*nsors is *mpty: ```pyt*on import t*nsor*low *s t* ori*_input = t*.*onst*nt([*, *], s**p*=[*, *, *, *], *typ*=t*.int**) ori*_out

Reasoning

T** vuln*r**ility st*ms *ir**tly *rom t** `*r**tion*lM*xPool*r**Op`'s `*omput*()` *un*tion impl*m*nt*tion, w*i** l**k** *ss*nti*l `v*li**tion` ****ks *s s*own in t** *ommit *i**. T** p*t** ***s `OP_R*QUIR*S` v*li**tions *or t*nsor *im*nsions *n* non-