6.5medium
Integer overflows in Tensorflow
- Severity
- 6.5medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.73% (higher than 50% of CVEs)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-6445-fm66-fvq2BIT-TENSORFLOW-2022-23568PYSEC-2022-132PYSEC-2022-77PYSEC-2026-3114
Description
Tensorflow is an Open Source Machine Learning Framework. The implementation of `AddManySparseToTensorsMap` is vulnerable to an integer overflow which results in a `CHECK`-fail when building new `TensorShape` objects (so, an assert failure based denial of service). We are missing some validation on the shapes of the input tensors as well as directly constructing a large `TensorShape` with user-provided dimensions. 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 b51b82fe65ebace4475e3c54eb089c18a4403f1c, before a68f68061e263a88321c104a6c911fe5598050a8 | 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 b51b82fe65ebace4475e3c54eb089c18a4403f1c, before a68f68061e263a88321c104a6c911fe5598050a8 | 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 `AddManySparseToTensorsMap` is vulnerable to an integer overflow which results in a `CHECK`-fail when building new `TensorShape` objects (so, an assert failure based denial of service). We are missing some validation on the shapes of the input tensors as well as directly constructing a large `TensorShape` with user-provided dimensions. 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 AddManySparseToTensorsMap is vulnerable to an integer overflow which results in a CHECK-fail when building new TensorShape objects (so, an assert failure based denial of service):
import tensorflow as tf
import numpy as np
tf.raw_ops.AddManySparseToTensorsMap(
sparse_indices=[(0,0),(0,1),(0,2),(4,3),(5,0),(5,1)],
sparse_values=[1,1,1,1,1,1],
sparse_shape=[2**32,2**32],
container='',
shared_name='',
name=None)
We are missing some validation on the shapes of the input tensors as well as directly constructing a large TensorShape with user-provided dimensions. The latter is an instance of TFSA-2021-198 (CVE-2021-41197) and is easily fixed by replacing a call to TensorShape constructor with a call to BuildTensorShape static helper factory.
Patches
We have patched the issue in GitHub commits b51b82fe65ebace4475e3c54eb089c18a4403f1c and a68f68061e263a88321c104a6c911fe5598050a8.
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 "AddManySparseToTensorsMap" es vulnerable a un desbordamiento de enteros que resulta en un fallo de "CHECK" cuando son construidos nuevos objetos "TensorShape" (por tanto, una denegación de servicio basada en un fallo de assert). Nos falta algo de comprobación en las formas de los tensores de entrada, así como construir directamente un "TensorShape" grande con las dimensiones proporcionadas por el usuario. 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/security/advisories/GHSA-6445-fm66-fvq2 | advisory, patch, third-party-advisory, web | |
| https://github.com/tensorflow/tensorflow/commit/a68f68061e263a88321c104a6c911fe5598050a8 | advisory, fix, patch, third-party-advisory, web | |
| https://github.com/tensorflow/tensorflow/commit/b51b82fe65ebace4475e3c54eb089c18a4403f1c | advisory, fix, patch, third-party-advisory, web | |
| https://github.com/tensorflow/tensorflow/blob/5100e359aef5c8021f2e71c7b986420b85ce7b3d/tensorflow/core/kernels/sparse_tensors_map_ops.cc | advisory, exploit, third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2022-23568 | advisory, web | |
| https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-cpu/PYSEC-2022-77.yaml | web | |
| https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-gpu/PYSEC-2022-132.yaml | web | |
| https://github.com/tensorflow/tensorflow | package | |
| https://pypi.org/project/tensorflow | package | |
| https://github.com/advisories/GHSA-6445-fm66-fvq2 | advisory | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2022-23568 changed 2025-05-05 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-6445-fm66-fvq2 changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2022-23568 changed 2026-06-17 | Public domain |
| PyPA Advisory Database | PYSEC-2022-132 changed 2026-07-13 | CC-BY-4.0 |
| PyPA Advisory Database | PYSEC-2022-77 changed 2026-07-13 | CC-BY-4.0 |
| PyPA Advisory Database | PYSEC-2026-3114 changed 2026-07-13 | CC-BY-4.0 |
| Bitnami Vulnerability Database | BIT-TENSORFLOW-2022-23568 changed 2026-09-08 | Apache-2.0 |