Miggo Logo

CVE-2021-41210: Heap OOB read in `tf.raw_ops.SparseCountSparseOutput`

7.1

CVSS Score
3.1

Basic Information

EPSS Score
0.03091%
Published
11/10/2021
Updated
11/7/2024
KEV Status
No
Technology
TechnologyPython

Technical Details

CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
tensorflowpip>= 2.6.0, < 2.6.12.6.1
tensorflowpip>= 2.5.0, < 2.5.22.5.2
tensorflowpip< 2.4.42.4.4
tensorflow-cpupip>= 2.6.0, < 2.6.12.6.1
tensorflow-cpupip>= 2.5.0, < 2.5.22.5.2
tensorflow-cpupip< 2.4.42.4.4
tensorflow-gpupip>= 2.6.0, < 2.6.12.6.1
tensorflow-gpupip>= 2.5.0, < 2.5.22.5.2
tensorflow-gpupip< 2.4.42.4.4

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems directly from the unvalidated rank check in SparseCountSparseOutputShapeFn. The commit diff shows the patched version adds a 'WithRank(c->input(0), 2)' check, confirming the original vulnerability was due to missing input rank validation. The C++ code's 'c->Dim(c->input(0), 1)' operation would attempt to read an invalid dimension when given rank-1 indices, matching the OOB read described in the advisory.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

### Imp**t T** [s**p* in**r*n** *un*tions *or `Sp*rs**ountSp*rs*Output`](*ttps://*it*u*.*om/t*nsor*low/t*nsor*low/*lo*/****************************************/t*nsor*low/*or*/ops/*ount_ops.**#L**-L**) **n tri***r * r*** outsi** o* *oun*s o* ***p *ll

Reasoning

T** vuln*r**ility st*ms *ir**tly *rom t** unv*li**t** r*nk ****k in Sp*rs**ountSp*rs*OutputS**p**n. T** *ommit *i** s*ows t** p*t**** v*rsion ***s * 'Wit*R*nk(*->input(*), *)' ****k, *on*irmin* t** ori*in*l vuln*r**ility w*s *u* to missin* input r*nk