Miggo Logo

CVE-2022-21728: Out of bounds read in Tensorflow

8.1

CVSS Score
3.1

Basic Information

EPSS Score
0.76722%
Published
2/9/2022
Updated
11/13/2024
KEV Status
No
Technology
TechnologyPython

Technical Details

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

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from two key points: 1) ReverseSequence's shape inference in array_ops.cc only checks upper bounds of batch_dim but allows negative values without validation. 2) DimKnownRank in shape_inference.h implements Python-style negative indexing but doesn't validate that 'idx >= -dims_.size()'. Together, when given a large negative batch_dim (e.g., -10 for a rank 2 tensor), DimKnownRank computes an invalid index (2 + (-10) = -8) leading to OOB read. The commit 37c01fb fixes this by adding explicit batch_dim >= 0 check in ReverseSequence's shape inference.

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* s**p* in**r*n** *or `R*v*rs*S*qu*n**`](*ttps://*it*u*.*om/t*nsor*low/t*nsor*low/*lo*/****************************************/t*nsor*low/*or*/ops/*rr*y_ops.**#L****-L****) *o*s not *ully v*li**t* t** v*lu* o* `**t**

Reasoning

T** vuln*r**ility st*ms *rom two k*y points: *) R*v*rs*S*qu*n**'s s**p* in**r*n** in *rr*y_ops.** only ****ks upp*r *oun*s o* **t**_*im *ut *llows n***tiv* v*lu*s wit*out v*li**tion. *) *imKnownR*nk in s**p*_in**r*n**.* impl*m*nts Pyt*on-styl* n***ti