Miggo Logo

CVE-2022-35983: TensorFlow vulnerable to `CHECK` fail in `Save` and `SaveSlices`

5.9

CVSS Score
3.1

Basic Information

EPSS Score
0.42671%
Published
9/16/2022
Updated
1/28/2023
KEV Status
No
Technology
TechnologyPython

Technical Details

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

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from how TensorSliceWriter handled unsupported dtypes:

  1. MaxBytesPerElement contained a LOG(FATAL) assertion that would crash the process when encountering unsupported dtypes
  2. SaveData template function called MaxBytesPerElement without first validating dtype support
  3. The commit patched this by introducing MaxBytesPerElementOrZero for safe checking and converting fatal assertions to proper error handling
  4. Test cases added in the commit specifically target dtype validation failures
  5. The vulnerability manifests in Save/SaveSlices ops which ultimately call these internal implementation functions

Vulnerable functions

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

WAF Protection Rules

WAF Rule

### Imp**t I* `S*v*` or `S*v*Sli**s` is run ov*r t*nsors o* *n unsupport** `*typ*`, it r*sults in * `****K` **il t**t **n ** us** to tri***r * **ni*l o* s*rvi** *tt**k. ```pyt*on import t*nsor*low *s t* *il*n*m* = t*.*onst*nt("") t*nsor_n*m*s = t*.*o

Reasoning

T** vuln*r**ility st*ms *rom *ow T*nsorSli**Writ*r **n*l** unsupport** *typ*s: *. M*x*yt*sP*r*l*m*nt *ont*in** * LO*(**T*L) *ss*rtion t**t woul* *r*s* t** pro**ss w**n *n*ount*rin* unsupport** *typ*s *. S*v***t* t*mpl*t* *un*tion **ll** M*x*yt*sP*r*l