CVE-2021-37637
JSON

7.7high

Null pointer dereference in `CompressElement` in TensorFlow

Severity
7.7high CVSS:3.1 by GitHub_M
Exploit likelihood
0.16% (higher than 5% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-c9qf-r67m-p7cgBIT-TENSORFLOW-2021-37637PYSEC-2021-259PYSEC-2021-550PYSEC-2021-748

Description

TensorFlow is an end-to-end open source platform for machine learning. It is possible to trigger a null pointer dereference in TensorFlow by passing an invalid input to `tf.raw_ops.CompressElement`. The [implementation](https://github.com/tensorflow/tensorflow/blob/47a06f40411a69c99f381495f490536972152ac0/tensorflow/core/data/compression_utils.cc#L34) was accessing the size of a buffer obtained from the return of a separate function call before validating that said buffer is valid. We have patched the issue in GitHub commit 5dc7f6981fdaf74c8c5be41f393df705841fb7c5. The fix will be included in TensorFlow 2.6.0. We will also cherrypick this commit on TensorFlow 2.5.1, TensorFlow 2.4.3, and TensorFlow 2.3.4, as these are also affected and still in supported range.

Affected

Product or packageVersionsReported by
tensorflow tensorflow>= 2.5.0, < 2.5.1, >= 2.4.0, < 2.4.3, < 2.3.4CVE List
tensorflow (PyPI)before 2.3.4, from 2.4.0 before 2.4.3, from 2.5.0 before 2.5.1, before 5dc7f6981fdaf74c8c5be41f393df705841fb7c5, from 2.3.0 before 2.3.4GitHub Advisory Database, PyPA Advisory Database
tensorflow-cpu (PyPI)before 2.3.4, from 2.4.0 before 2.4.3, from 2.5.0 before 2.5.1, before 5dc7f6981fdaf74c8c5be41f393df705841fb7c5, from 2.3.0 before 2.3.4GitHub Advisory Database, PyPA Advisory Database
tensorflow-gpu (PyPI)before 2.3.4, from 2.4.0 before 2.4.3, from 2.5.0 before 2.5.1, before 5dc7f6981fdaf74c8c5be41f393df705841fb7c5, from 2.3.0 before 2.3.4GitHub Advisory Database, PyPA Advisory Database
google tensorflowfrom 2.3.0 before 2.3.4, from 2.4.0 before 2.4.3, 2.5.0, 2.6.0NVD
tensorflow (Bitnami)from 2.3.0 before 2.3.4, from 2.4.0 before 2.4.3, from 2.5.0 before 2.5.1Bitnami Vulnerability Database

All scores

GitHub_M7.7high CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H
GitHub7.7high CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H
GitHubhigh CVSS:4.0CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N
NVD5.5medium CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
NVD2.1low CVSS:2.0AV:L/AC:L/Au:N/C:N/I:N/A:P
Bitnami Vulnerability Databasehigh rating

Classification

What each source says

CVE List

TensorFlow is an end-to-end open source platform for machine learning. It is possible to trigger a null pointer dereference in TensorFlow by passing an invalid input to `tf.raw_ops.CompressElement`. The [implementation](https://github.com/tensorflow/tensorflow/blob/47a06f40411a69c99f381495f490536972152ac0/tensorflow/core/data/compression_utils.cc#L34) was accessing the size of a buffer obtained from the return of a separate function call before validating that said buffer is valid. We have patched the issue in GitHub commit 5dc7f6981fdaf74c8c5be41f393df705841fb7c5. The fix will be included in TensorFlow 2.6.0. We will also cherrypick this commit on TensorFlow 2.5.1, TensorFlow 2.4.3, and TensorFlow 2.3.4, as these are also affected and still in supported range.

GitHub Advisory Database
Impact

It is possible to trigger a null pointer dereference in TensorFlow by passing an invalid input to tf.raw_ops.CompressElement:

import tensorflow as tf

tf.raw_ops.CompressElement(components=[[]])

The implementation was accessing the size of a buffer obtained from the return of a separate function call before validating that said buffer is valid.

Patches

We have patched the issue in GitHub commit 5dc7f6981fdaf74c8c5be41f393df705841fb7c5.

The fix will be included in TensorFlow 2.6.0. We will also cherrypick this commit on TensorFlow 2.5.1, TensorFlow 2.4.3, and TensorFlow 2.3.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 has been reported by members of the Aivul Team from Qihoo 360. Concurrently, it was resolved in master branch as it was also discovered internally and fixed before the report was handled.

NVD (es)

TensorFlow es una plataforma de código abierto de extremo a extremo para el aprendizaje automático. Es posible desencadenar una desreferencia de puntero null en TensorFlow pasando una entrada no válida a "tf.raw_ops.CompressElement". La [implementación](https://github.com/tensorflow/tensorflow/blob/47a06f40411a69c99f381495f490536972152ac0/tensorflow/core/data/compression_utils.cc#L34) estaba accediendo al tamaño de un buffer obtenido del retorno de una llamada a una función separada antes de comprender que dicho buffer es válido. Hemos parcheado el problema en el commit 5dc7f6981fdaf74c8c5be41f393df705841fb7c5 de GitHub. La corrección se incluirá en TensorFlow versión 2.6.0. También se incluirá este commit en TensorFlow versión 2.5.1, TensorFlow versión 2.4.3, y TensorFlow versión 2.3.4, ya que estos también están afectados y todavía están en el rango de soporte.

References

Sources

SourceRecordLicence
CVE ListCVE-2021-37637 changed 2024-08-04CVE Terms of Use
GitHub Advisory DatabaseGHSA-c9qf-r67m-p7cg changed 2026-07-08CC-BY-4.0
NVDCVE-2021-37637 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2021-259 changed 2023-12-06CC-BY-4.0
PyPA Advisory DatabasePYSEC-2021-550 changed 2023-12-06CC-BY-4.0
PyPA Advisory DatabasePYSEC-2021-748 changed 2023-12-06CC-BY-4.0
Bitnami Vulnerability DatabaseBIT-TENSORFLOW-2021-37637 changed 2026-09-10Apache-2.0