Miggo Logo

CVE-2021-37639:
Null pointer dereference and heap OOB read in operations restoring tensors

8.4

CVSS Score
3.1

Basic Information

EPSS Score
0.00962%
Published
8/25/2021
Updated
11/13/2024
KEV Status
No
Technology
TechnologyPython

Technical Details

CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
tensorflowpip< 2.3.42.3.4
tensorflowpip>= 2.4.0, < 2.4.32.4.3
tensorflowpip= 2.5.02.5.1
tensorflow-cpupip< 2.3.42.3.4
tensorflow-cpupip>= 2.4.0, < 2.4.32.4.3
tensorflow-cpupip= 2.5.02.5.1
tensorflow-gpupip< 2.3.42.3.4
tensorflow-gpupip>= 2.4.0, < 2.4.32.4.3
tensorflow-gpupip= 2.5.02.5.1

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems directly from the implementation of RestoreTensor in save_restore_tensor.cc. The commit diff shows the patch adds validation for tensor_name list size in this function, confirming it was previously missing bounds checks. Both tf.raw_ops.Restore and RestoreSlice operations ultimately call this core restoration logic. The lack of size validation before accessing tensor_name_t.flat<tstring>()(restore_index) directly enables the described CWE-125 and CWE-476 vulnerabilities.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

### Imp**t W**n r*storin* t*nsors vi* r*w *PIs, i* t** t*nsor n*m* is not provi***, T*nsor*low **n ** tri*k** into **r***r*n*in* * null point*r: ```pyt*on import t*nsor*low *s t* t*.r*w_ops.R*stor*( *il*_p*tt*rn=['/tmp'], t*nsor_n*m*=[], ***

Reasoning

T** vuln*r**ility st*ms *ir**tly *rom t** impl*m*nt*tion o* R*stor*T*nsor in s*v*_r*stor*_t*nsor.**. T** *ommit *i** s*ows t** p*t** ***s v*li**tion *or t*nsor_n*m* list siz* in t*is *un*tion, *on*irmin* it w*s pr*viously missin* *oun*s ****ks. *ot*