CVE-2022-23568
JSON

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 packageVersionsReported by
Unspecified productn/aCVE List
tensorflow (PyPI)before 2.5.3, from 2.6.0 before 2.6.3, from 2.7.0 before 2.7.1GitHub 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 a68f68061e263a88321c104a6c911fe5598050a8GitHub 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 a68f68061e263a88321c104a6c911fe5598050a8GitHub Advisory Database, PyPA Advisory Database
google tensorflowup to 2.5.2, from 2.6.0 up to 2.6.2, 2.7.0NVD
tensorflow (Bitnami)before 2.5.3, from 2.6.0 before 2.6.3, from 2.7.0 before 2.7.1Bitnami Vulnerability Database

All scores

GitHub_M6.5medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
GitHub6.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
GitHubhigh CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
NVD6.5medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
NVD4.0medium CVSS:2.0AV:N/AC:L/Au:S/C:N/I:N/A:P
PyPA Advisory Database6.5medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
PyPA Advisory DatabaseNot scored CVSS:4.0CVSS: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 Databasemedium rating

Classification

CWE-190

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-fvq2advisory, patch, third-party-advisory, web
https://github.com/tensorflow/tensorflow/commit/a68f68061e263a88321c104a6c911fe5598050a8advisory, fix, patch, third-party-advisory, web
https://github.com/tensorflow/tensorflow/commit/b51b82fe65ebace4475e3c54eb089c18a4403f1cadvisory, fix, patch, third-party-advisory, web
https://github.com/tensorflow/tensorflow/blob/5100e359aef5c8021f2e71c7b986420b85ce7b3d/tensorflow/core/kernels/sparse_tensors_map_ops.ccadvisory, exploit, third-party-advisory, web
https://nvd.nist.gov/vuln/detail/CVE-2022-23568advisory, web
https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-cpu/PYSEC-2022-77.yamlweb
https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-gpu/PYSEC-2022-132.yamlweb
https://github.com/tensorflow/tensorflowpackage
https://pypi.org/project/tensorflowpackage
https://github.com/advisories/GHSA-6445-fm66-fvq2advisory

Sources

SourceRecordLicence
CVE ListCVE-2022-23568 changed 2025-05-05CVE Terms of Use
GitHub Advisory DatabaseGHSA-6445-fm66-fvq2 changed 2026-09-10CC-BY-4.0
NVDCVE-2022-23568 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2022-132 changed 2026-07-13CC-BY-4.0
PyPA Advisory DatabasePYSEC-2022-77 changed 2026-07-13CC-BY-4.0
PyPA Advisory DatabasePYSEC-2026-3114 changed 2026-07-13CC-BY-4.0
Bitnami Vulnerability DatabaseBIT-TENSORFLOW-2022-23568 changed 2026-09-08Apache-2.0