Miggo Logo

CVE-2022-36015: TensorFlow vulnerable to integer overflow in math ops

7.5

CVSS Score
3.1

Basic Information

EPSS Score
0.47984%
Published
9/16/2022
Updated
1/28/2023
KEV Status
No
Technology
TechnologyPython

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
tensorflowpip< 2.7.22.7.2
tensorflowpip>= 2.8.0, < 2.8.12.8.1
tensorflowpip>= 2.9.0, < 2.9.12.9.1
tensorflow-cpupip< 2.7.22.7.2
tensorflow-cpupip>= 2.8.0, < 2.8.12.8.1
tensorflow-cpupip>= 2.9.0, < 2.9.12.9.1
tensorflow-gpupip< 2.7.22.7.2
tensorflow-gpupip>= 2.8.0, < 2.8.12.8.1
tensorflow-gpupip>= 2.9.0, < 2.9.12.9.1

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability manifests in RangeSize's calculation logic for integral types. The pre-patch code computes size using arithmetic operations that might overflow before the subsequent validation check. The critical issues are: 1) Intermediate values in the size calculation could exceed int64_t limits, 2) The overflow check occurs after potentially overflowing operations. The patch replaces this with Eigen::divup with explicit int64_t casting, demonstrating the original code's vulnerability to integer overflow during size computation.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

### Imp**t W**n [`R*n**Siz*`](*ttps://*it*u*.*om/t*nsor*low/t*nsor*low/*lo*/m*st*r/t*nsor*low/*or*/ops/m*t*_ops.**) r***iv*s v*lu*s t**t *o not *it into *n `int**_t`, it *r*s**s. ```*pp *uto siz* = (st*::is_int**r*l<T>::v*lu* ? (

Reasoning

T** vuln*r**ility m*ni**sts in R*n**Siz*'s **l*ul*tion lo*i* *or int**r*l typ*s. T** pr*-p*t** *o** *omput*s siz* usin* *rit*m*ti* op*r*tions t**t mi**t ov*r*low ***or* t** su*s*qu*nt v*li**tion ****k. T** *riti**l issu*s *r*: *) Int*rm**i*t* v*lu*s