Miggo Logo

CVE-2022-29208: Segfault and OOB write due to incomplete validation in `EditDistance` in TensorFlow

7.1

CVSS Score
3.1

Basic Information

EPSS Score
0.31172%
Published
5/24/2022
Updated
1/30/2023
KEV Status
No
Technology
TechnologyPython

Technical Details

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

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from multiple instances in EditDistanceOp::Compute where std::inner_product calculates a 'loc' index for tensor writes. The original validation (OP_REQUIRES) only checked against the upper bound of the output buffer. The patch explicitly adds 0 <= loc validation in 5 locations in edit_distance_op.cc, confirming these were the vulnerable code paths. The CVE description explicitly references this pattern of missing negative index validation in write operations.

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.**it*ist*n**`]() **s in*ompl*t* v*li**tion. Us*rs **n p*ss n***tiv* v*lu*s to **us* * s**m*nt*tion **ult **s** **ni*l o* s*rvi**: ```pyt*on import t*nsor*low *s t* *ypot**sis_in*i**s = t*.*onst*nt(-****

Reasoning

T** vuln*r**ility st*ms *rom multipl* inst*n**s in **it*ist*n**Op::*omput* w**r* st*::inn*r_pro*u*t **l*ul*t*s * 'lo*' in**x *or t*nsor writ*s. T** ori*in*l v*li**tion (OP_R*QUIR*S) only ****k** ***inst t** upp*r *oun* o* t** output *u***r. T** p*t**