Miggo Logo

CVE-2022-41911: Invalid char to bool conversion when printing a tensor

4.8

CVSS Score
3.1

Basic Information

EPSS Score
0.2119%
Published
11/21/2022
Updated
2/1/2023
KEV Status
No
Technology
TechnologyPython

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:N/I:N/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
tensorflowpip< 2.8.42.8.4
tensorflow-cpupip>= 2.9.0, < 2.9.32.9.3
tensorflow-gpupip>= 2.10.0, < 2.10.12.10.1
tensorflowpip>= 2.9.0, < 2.9.32.9.3
tensorflowpip>= 2.10.0, < 2.10.12.10.1
tensorflow-cpupip< 2.8.42.8.4
tensorflow-gpupip< 2.8.42.8.4
tensorflow-gpupip>= 2.9.0, < 2.9.32.9.3
tensorflow-cpupip>= 2.10.0, < 2.10.12.10.1

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from unsafe char-to-bool conversion in tensor printing logic. The original implementation of SummarizeArray<bool> (template specialization) directly reinterpret_casted char* storage to bool* without validation. This violates C++ requirements that bool must be 0 or 1, causing sanitizer crashes. The patch adds a dedicated bool specialization that sanitizes char values to 0/1 before conversion, confirming this was the vulnerable code path. The file location and function are explicitly shown in the commit diff.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

### Imp**t W**n [printin* * t*nsor](*ttps://*it*u*.*om/t*nsor*low/t*nsor*low/*lo*/****************************************/t*nsor*low/*or*/*r*m*work/t*nsor.**#L****-L****), w* **t it's **t* *s * `*onst ***r*` *rr*y (sin** t**t's t** un**rlyin* stor**

Reasoning

T** vuln*r**ility st*ms *rom uns*** ***r-to-*ool *onv*rsion in t*nsor printin* lo*i*. T** ori*in*l impl*m*nt*tion o* Summ*riz**rr*y<*ool> (t*mpl*t* sp**i*liz*tion) *ir**tly r*int*rpr*t_**st** ***r* stor*** to *ool* wit*out v*li**tion. T*is viol*t*s *