4.8medium
Invalid char to bool conversion when printing a tensor in Tensorflow
- Severity
- 4.8medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.58% (higher than 48% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-pf36-r9c6-h97jBIT-TENSORFLOW-2022-41911PYSEC-2026-1954PYSEC-2026-3222PYSEC-2026-939
Description
TensorFlow is an open source platform for machine learning. When printing a tensor, we get it's data as a `const char*` array (since that's the underlying storage) and then we typecast it to the element type. However, conversions from `char` to `bool` are undefined if the `char` is not `0` or `1`, so sanitizers/fuzzers will crash. The issue has been patched in GitHub commit `1be74370327`. The fix will be included in TensorFlow 2.11.0. We will also cherrypick this commit on TensorFlow 2.10.1, TensorFlow 2.9.3, and TensorFlow 2.8.4, as these are also affected and still in supported range.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| tensorflow tensorflow | >= 2.10.0, < 2.10.1, >= 2.9.0, < 2.9.3, < 2.8.4 | CVE List |
| tensorflow (PyPI) | before 2.8.4, from 2.9.0 before 2.9.3, from 2.10.0 before 2.10.1 | GitHub Advisory Database, PyPA Advisory Database |
| tensorflow-cpu (PyPI) | from 2.9.0 before 2.9.3, before 2.8.4, from 2.10.0 before 2.10.1 | GitHub Advisory Database, PyPA Advisory Database |
| tensorflow-gpu (PyPI) | from 2.10.0 before 2.10.1, before 2.8.4, from 2.9.0 before 2.9.3 | GitHub Advisory Database, PyPA Advisory Database |
| google tensorflow | before 2.8.4, from 2.9.0 before 2.9.3, 2.10.0 | NVD |
| tensorflow (Bitnami) | before 2.8.4, from 2.9.0 before 2.9.3, from 2.10.0 before 2.10.1 | Bitnami Vulnerability Database |
All scores
| GitHub_M | 4.8medium CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:N/I:N/A:H |
| GitHub | 4.8medium CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:N/I:N/A:H |
| NVD | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| PyPA Advisory Database | 4.8medium CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:N/I:N/A:H |
| Bitnami Vulnerability Database | high rating |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
TensorFlow is an open source platform for machine learning. When printing a tensor, we get it's data as a `const char*` array (since that's the underlying storage) and then we typecast it to the element type. However, conversions from `char` to `bool` are undefined if the `char` is not `0` or `1`, so sanitizers/fuzzers will crash. The issue has been patched in GitHub commit `1be74370327`. The fix will be included in TensorFlow 2.11.0. We will also cherrypick this commit on TensorFlow 2.10.1, TensorFlow 2.9.3, and TensorFlow 2.8.4, as these are also affected and still in supported range.
GitHub Advisory Database
Impact
When printing a tensor, we get it's data as a const char* array (since that's the underlying storage) and then we typecast it to the element type. However, conversions from char to bool are undefined if the char is not 0 or 1, so sanitizers/fuzzers will crash.
Patches
We have patched the issue in GitHub commit 1be743703279782a357adbf9b77dcb994fe8b508.
The fix will be included in TensorFlow 2.11.0. We will also cherrypick this commit on TensorFlow 2.10.1, TensorFlow 2.9.3, and TensorFlow 2.8.4, as these are also affected and still in supported range.
For more information
Please consult our security guide for more information regarding the security model and how to contact us with issues and questions.
Attribution
This vulnerability was discovered via internal fuzzing.
NVD (es)
TensorFlow es una plataforma de código abierto para aprendizaje automático. Al imprimir un tensor, obtenemos sus datos como una matriz `const char*` (ya que ese es el almacenamiento subyacente) y luego los encasillamos al tipo de elemento. Sin embargo, las conversiones de `char` a `bool` no están definidas si `char` no es `0` o `1`, por lo que los sanitizadores/fuzzers fallarán. El problema se solucionó en el commit de GitHub `1be74370327`. La solución se incluirá en TensorFlow 2.11.0. También seleccionaremos este commit en TensorFlow 2.10.1, TensorFlow 2.9.3 y TensorFlow 2.8.4, ya que estos también se ven afectados y aún se encuentran en el rango admitido.
References
| https://github.com/tensorflow/tensorflow/security/advisories/GHSA-pf36-r9c6-h97j | advisory, patch, third-party-advisory, web | |
| https://github.com/tensorflow/tensorflow/commit/1be743703279782a357adbf9b77dcb994fe8b508 | advisory, fix, patch, third-party-advisory, web | |
| https://github.com/tensorflow/tensorflow/blob/807cae8a807960fd7ac2313cde73a11fc15e7942/tensorflow/core/framework/tensor.cc#L1200-L1227 | advisory, patch, third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2022-41911 | advisory, web | |
| https://github.com/tensorflow/tensorflow | package | |
| https://pypi.org/project/tensorflow-cpu | package | |
| https://github.com/advisories/GHSA-pf36-r9c6-h97j | advisory | |
| https://pypi.org/project/tensorflow | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2022-41911 changed 2025-04-23 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-pf36-r9c6-h97j changed 2026-07-13 | CC-BY-4.0 |
| NVD | CVE-2022-41911 changed 2026-06-17 | Public domain |
| PyPA Advisory Database | PYSEC-2026-1954 changed 2026-07-13 | CC-BY-4.0 |
| PyPA Advisory Database | PYSEC-2026-3222 changed 2026-07-13 | CC-BY-4.0 |
| PyPA Advisory Database | PYSEC-2026-939 changed 2026-07-13 | CC-BY-4.0 |
| Bitnami Vulnerability Database | BIT-TENSORFLOW-2022-41911 changed 2026-09-08 | Apache-2.0 |