CVE-2022-41911: Invalid char to bool conversion when printing a tensor
4.8
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.2119%
CWE
Published
11/21/2022
Updated
2/1/2023
KEV Status
No
Technology
Python
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:N/I:N/A:H
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| tensorflow | pip | < 2.8.4 | 2.8.4 |
| tensorflow-cpu | pip | >= 2.9.0, < 2.9.3 | 2.9.3 |
| tensorflow-gpu | pip | >= 2.10.0, < 2.10.1 | 2.10.1 |
| tensorflow | pip | >= 2.9.0, < 2.9.3 | 2.9.3 |
| tensorflow | pip | >= 2.10.0, < 2.10.1 | 2.10.1 |
| tensorflow-cpu | pip | < 2.8.4 | 2.8.4 |
| tensorflow-gpu | pip | < 2.8.4 | 2.8.4 |
| tensorflow-gpu | pip | >= 2.9.0, < 2.9.3 | 2.9.3 |
| tensorflow-cpu | pip | >= 2.10.0, < 2.10.1 | 2.10.1 |
Vulnerability Intelligence
Miggo AI
Root 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.