6.5medium
Integer overflow leading to crash in Tensorflow
- Severity
- 6.5medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.72% (higher than 50% of CVEs)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-x4qx-4fjv-hmw6BIT-TENSORFLOW-2022-21738PYSEC-2022-117PYSEC-2022-62PYSEC-2026-3258
Description
Tensorflow is an Open Source Machine Learning Framework. The implementation of `SparseCountSparseOutput` can be made to crash a TensorFlow process by an integer overflow whose result is then used in a memory allocation. The fix will be included in TensorFlow 2.8.0. We will also cherrypick this commit on TensorFlow 2.7.1, TensorFlow 2.6.3, and TensorFlow 2.5.3, as these are also affected and still in supported range.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Unspecified product | n/a | CVE List |
| tensorflow (PyPI) | before 2.5.3, from 2.6.0 before 2.6.3, from 2.7.0 before 2.7.1 | GitHub Advisory Database, PyPA Advisory Database |
| tensorflow-cpu (PyPI) | before 2.5.3, from 2.6.0 before 2.6.3, from 2.7.0 before 2.7.1, before 6f4d3e8139ec724dbbcb40505891c81dd1052c4a | GitHub Advisory Database, PyPA Advisory Database |
| tensorflow-gpu (PyPI) | before 2.5.3, from 2.6.0 before 2.6.3, from 2.7.0 before 2.7.1, before 6f4d3e8139ec724dbbcb40505891c81dd1052c4a | GitHub Advisory Database, PyPA Advisory Database |
| google tensorflow | up to 2.5.2, from 2.6.0 up to 2.6.2, 2.7.0 | NVD |
| tensorflow (Bitnami) | before 2.5.3, from 2.6.0 before 2.6.3, from 2.7.0 before 2.7.1 | Bitnami Vulnerability Database |
All scores
| GitHub_M | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H |
| GitHub | 6.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H |
| GitHub | high CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N |
| NVD | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H |
| NVD | 4.0medium CVSS:2.0 | AV:N/AC:L/Au:S/C:N/I:N/A:P |
| PyPA Advisory Database | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H |
| PyPA Advisory Database | Not scored CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N |
| Bitnami Vulnerability Database | medium rating |
Classification
SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.
What each source says
CVE List
Tensorflow is an Open Source Machine Learning Framework. The implementation of `SparseCountSparseOutput` can be made to crash a TensorFlow process by an integer overflow whose result is then used in a memory allocation. The fix will be included in TensorFlow 2.8.0. We will also cherrypick this commit on TensorFlow 2.7.1, TensorFlow 2.6.3, and TensorFlow 2.5.3, as these are also affected and still in supported range.
GitHub Advisory Database
Impact
The implementation of SparseCountSparseOutput can be made to crash a TensorFlow process by an integer overflow whose result is then used in a memory allocation:
import tensorflow as tf
import numpy as np
tf.raw_ops.SparseCountSparseOutput(
indices=[[1,1]],
values=[2],
dense_shape=[2 ** 31, 2 ** 32],
weights=[1],
binary_output=True,
minlength=-1,
maxlength=-1,
name=None)
Patches
We have patched the issue in GitHub commit 6f4d3e8139ec724dbbcb40505891c81dd1052c4a.
The fix will be included in TensorFlow 2.8.0. We will also cherrypick this commit on TensorFlow 2.7.1, TensorFlow 2.6.3, and TensorFlow 2.5.3, 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 has been reported by Faysal Hossain Shezan from University of Virginia.
NVD (es)
Tensorflow es un marco de aprendizaje automático de código abierto. La implementación de "SparseCountSparseOutput" puede hacer que un proceso de TensorFlow se bloquee por un desbordamiento de enteros cuyo resultado es usado en una asignación de memoria. La corrección será incluida en TensorFlow versión 2.8.0. También seleccionaremos este commit en TensorFlow versión 2.7.1, TensorFlow versión 2.6.3, y TensorFlow versión 2.5.3, ya que estos también están afectados y aún están en el rango admitido
References
| https://github.com/tensorflow/tensorflow/blob/5100e359aef5c8021f2e71c7b986420b85ce7b3d/tensorflow/core/kernels/count_ops.cc#L168-L273 | advisory, exploit, third-party-advisory, web | |
| https://github.com/tensorflow/tensorflow/security/advisories/GHSA-x4qx-4fjv-hmw6 | advisory, patch, third-party-advisory, web | |
| https://github.com/tensorflow/tensorflow/commit/6f4d3e8139ec724dbbcb40505891c81dd1052c4a | advisory, fix, patch, third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2022-21738 | advisory, web | |
| https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-cpu/PYSEC-2022-62.yaml | web | |
| https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-gpu/PYSEC-2022-117.yaml | web | |
| https://github.com/tensorflow/tensorflow | package | |
| https://pypi.org/project/tensorflow | package | |
| https://github.com/advisories/GHSA-x4qx-4fjv-hmw6 | advisory | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2022-21738 changed 2025-05-05 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-x4qx-4fjv-hmw6 changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2022-21738 changed 2026-06-17 | Public domain |
| PyPA Advisory Database | PYSEC-2022-117 changed 2026-07-13 | CC-BY-4.0 |
| PyPA Advisory Database | PYSEC-2022-62 changed 2026-07-13 | CC-BY-4.0 |
| PyPA Advisory Database | PYSEC-2026-3258 changed 2026-07-13 | CC-BY-4.0 |
| Bitnami Vulnerability Database | BIT-TENSORFLOW-2022-21738 changed 2026-09-08 | Apache-2.0 |