Miggo Logo

CVE-2022-41902: Out of bounds write in grappler in Tensorflow

7.1

CVSS Score
3.1

Basic Information

EPSS Score
0.48151%
Published
11/21/2022
Updated
9/18/2023
KEV Status
No
Technology
TechnologyPython

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
tensorflowpip< 2.8.42.8.4
tensorflowpip>= 2.9.0, < 2.9.32.9.3
tensorflowpip>= 2.10.0, < 2.10.12.10.1
tensorflow-cpupip< 2.8.42.8.4
tensorflow-gpupip< 2.8.42.8.4
tensorflow-cpupip>= 2.9.0, < 2.9.32.9.3
tensorflow-gpupip>= 2.9.0, < 2.9.32.9.3
tensorflow-cpupip>= 2.10.0, < 2.10.12.10.1
tensorflow-gpupip>= 2.10.0, < 2.10.12.10.1

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from MakeGrapplerFunctionItem's handling of function argument attributes. The commit diff shows a critical bounds check was added for attr.first before accessing arg_attr.at(attr.first). Without this check, invalid attribute indices would trigger an out-of-bounds write in the std::vector<const FunctionDef::ArgAttrs*> arg_attr container. This matches the CWE-787 (OOB Write) and CWE-125 (OOB Read) descriptions in the advisory. The function's role in processing TensorFlow function definitions makes it a clear candidate for the vulnerability described.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

### Imp**t T** *un*tion [M*k**r*ppl*r*un*tionIt*m](*ttps://*ttps://*it*u*.*om/t*nsor*low/t*nsor*low/*lo*/m*st*r/t*nsor*low/*or*/*r*ppl*r/utils/*un*tions.**#L***) t*k*s *r*um*nts t**t **t*rmin* t** siz*s o* inputs *n* outputs. I* t** inputs *iv*n *r*

Reasoning

T** vuln*r**ility st*ms *rom M*k**r*ppl*r*un*tionIt*m's **n*lin* o* *un*tion *r*um*nt *ttri*ut*s. T** *ommit *i** s*ows * *riti**l *oun*s ****k w*s ***** *or *ttr.*irst ***or* ****ssin* *r*_*ttr.*t(*ttr.*irst). Wit*out t*is ****k, inv*li* *ttri*ut* i