2.5low
Segfault in tf.raw_ops.ImmutableConst
- Severity
- 2.5low CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.19% (higher than 8% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-g4h2-gqm3-c9wqBIT-TENSORFLOW-2021-29539PYSEC-2021-176PYSEC-2021-467PYSEC-2021-665
Description
TensorFlow is an end-to-end open source platform for machine learning. Calling `tf.raw_ops.ImmutableConst`(https://www.tensorflow.org/api_docs/python/tf/raw_ops/ImmutableConst) with a `dtype` of `tf.resource` or `tf.variant` results in a segfault in the implementation as code assumes that the tensor contents are pure scalars. We have patched the issue in 4f663d4b8f0bec1b48da6fa091a7d29609980fa4 and will release TensorFlow 2.5.0 containing the patch. TensorFlow nightly packages after this commit will also have the issue resolved. If using `tf.raw_ops.ImmutableConst` in code, you can prevent the segfault by inserting a filter for the `dtype` argument.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| tensorflow tensorflow | < 2.1.4, >= 2.2.0, < 2.2.3, >= 2.3.0, < 2.3.3, >= 2.4.0, < 2.4.2 | CVE List |
| tensorflow (PyPI) | before 2.1.4, from 2.2.0 before 2.2.3, from 2.3.0 before 2.3.3, from 2.4.0 before 2.4.2, before 4f663d4b8f0bec1b48da6fa091a7d29609980fa4, before 2.2.0rc0, from 2.2.0 before 2.3.0rc0, from 2.3.0 before 2.3.4 and 1 more | GitHub Advisory Database, PyPA Advisory Database |
| tensorflow-cpu (PyPI) | before 2.1.4, from 2.2.0 before 2.2.3, from 2.3.0 before 2.3.3, from 2.4.0 before 2.4.2, before 4f663d4b8f0bec1b48da6fa091a7d29609980fa4, before 2.2.0rc0, from 2.2.0 before 2.3.0rc0, from 2.3.0 before 2.3.4 and 1 more | GitHub Advisory Database, PyPA Advisory Database |
| tensorflow-gpu (PyPI) | before 2.1.4, from 2.2.0 before 2.2.3, from 2.3.0 before 2.3.3, from 2.4.0 before 2.4.2, before 4f663d4b8f0bec1b48da6fa091a7d29609980fa4, before 2.2.0rc0, from 2.2.0 before 2.3.0rc0, from 2.3.0 before 2.3.4 and 1 more | GitHub Advisory Database, PyPA Advisory Database |
| google tensorflow | before 2.1.4, from 2.2.0 before 2.2.3, from 2.3.0 before 2.3.3, from 2.4.0 before 2.4.2 | NVD |
| tensorflow (Bitnami) | before 2.1.4, from 2.2.0 before 2.2.3, from 2.3.0 before 2.3.3, from 2.4.0 before 2.4.2 | Bitnami Vulnerability Database |
All scores
| GitHub_M | 2.5low CVSS:3.1 | CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:L |
| GitHub | 2.5low CVSS:3.1 | CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:L |
| GitHub | low CVSS:4.0 | CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N |
| NVD | 5.5medium CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H |
| NVD | 2.1low CVSS:2.0 | AV:L/AC:L/Au:N/C:N/I:N/A:P |
| Bitnami Vulnerability Database | medium rating |
Classification
What each source says
CVE List
TensorFlow is an end-to-end open source platform for machine learning. Calling `tf.raw_ops.ImmutableConst`(https://www.tensorflow.org/api_docs/python/tf/raw_ops/ImmutableConst) with a `dtype` of `tf.resource` or `tf.variant` results in a segfault in the implementation as code assumes that the tensor contents are pure scalars. We have patched the issue in 4f663d4b8f0bec1b48da6fa091a7d29609980fa4 and will release TensorFlow 2.5.0 containing the patch. TensorFlow nightly packages after this commit will also have the issue resolved. If using `tf.raw_ops.ImmutableConst` in code, you can prevent the segfault by inserting a filter for the `dtype` argument.
GitHub Advisory Database
Impact
Calling tf.raw_ops.ImmutableConst with a dtype of tf.resource or tf.variant results in a segfault in the implementation as code assumes that the tensor contents are pure scalars.
>>> import tensorflow as tf
>>> tf.raw_ops.ImmutableConst(dtype=tf.resource, shape=[], memory_region_name="/tmp/test.txt")
...
Segmentation fault
Patches
We have patched the issue in 4f663d4b8f0bec1b48da6fa091a7d29609980fa4 and will release TensorFlow 2.5.0 containing the patch. TensorFlow nightly packages after this commit will also have the issue resolved.
Workarounds
If using tf.raw_ops.ImmutableConst in code, you can prevent the segfault by inserting a filter for the dtype argument.
For more information
Please consult our security guide for more information regarding the security model and how to contact us with issues and questions.
NVD (es)
TensorFlow es una plataforma de código abierto de extremo a extremo para el aprendizaje automático. Llamar a "tf.raw_ops.ImmutableConst" (https://www.tensorflow.org/api_docs/python/tf/raw_ops/ImmutableConst) con un" dtype" de "tf.resource" o" tf.variant" resulta en un fallo de segmentación en una implementación como código se asume que los contenidos del tensor son escalares puros. Hemos parcheado el problema en 4f663d4b8f0bec1b48da6fa091a7d29609980fa4 y lanzaremos TensorFlow versión 2.5.0 que contiene el parche. Los paquetes nocturnos de TensorFlow después de este commit también resolverán el problema. Si usa "tf.raw_ops.ImmutableConst" en el código, puede impedir el fallo de segmentación al insertar un filtro para el argumento "dtype"
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-29539 changed 2024-08-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-g4h2-gqm3-c9wq changed 2026-07-08 | CC-BY-4.0 |
| NVD | CVE-2021-29539 changed 2026-06-17 | Public domain |
| PyPA Advisory Database | PYSEC-2021-176 changed 2023-12-06 | CC-BY-4.0 |
| PyPA Advisory Database | PYSEC-2021-467 changed 2023-12-06 | CC-BY-4.0 |
| PyPA Advisory Database | PYSEC-2021-665 changed 2023-12-06 | CC-BY-4.0 |
| Bitnami Vulnerability Database | BIT-TENSORFLOW-2021-29539 changed 2026-09-08 | Apache-2.0 |