GitHub Advisoryadvisory · PyPI
GHSA-g4h2-gqm3-c9wq Segfault in tf.raw_ops.ImmutableConst
LOW
Official page ↗
- Aliases
- CVE-2021-29539
- Ecosystem
- PyPI
- Packages
- tensorflow, tensorflow-cpu, tensorflow-gpu
- Severity
- Low
- CVSS vector
- CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:L
- Weaknesses
- CWE-681
- Reviewed
- 2021-05-18
Affected packages
• PyPI tensorflow: < 2.1.4 → fixed in 2.1.4
• PyPI tensorflow: >= 2.2.0, < 2.2.3 → fixed in 2.2.3
• PyPI tensorflow: >= 2.3.0, < 2.3.3 → fixed in 2.3.3
• PyPI tensorflow: >= 2.4.0, < 2.4.2 → fixed in 2.4.2
• PyPI tensorflow-cpu: < 2.1.4 → fixed in 2.1.4
• PyPI tensorflow-cpu: >= 2.2.0, < 2.2.3 → fixed in 2.2.3
• PyPI tensorflow-cpu: >= 2.3.0, < 2.3.3 → fixed in 2.3.3
• PyPI tensorflow-cpu: >= 2.4.0, < 2.4.2 → fixed in 2.4.2
• PyPI tensorflow-gpu: < 2.1.4 → fixed in 2.1.4
• PyPI tensorflow-gpu: >= 2.2.0, < 2.2.3 → fixed in 2.2.3
• PyPI tensorflow-gpu: >= 2.3.0, < 2.3.3 → fixed in 2.3.3
• PyPI tensorflow-gpu: >= 2.4.0, < 2.4.2 → fixed in 2.4.2
Description
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.
```python
>>> 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.
Related
Alias · CVE (1)
- CVE-2021-29539 TensorFlow is an end-to-end open source platform for machine learning. vulnerability
Weakness · CWE (1)
- CWE-681 Incorrect Conversion between Numeric Types weakness
References
- https://github.com/tensorflow/tensorflow/security/advisories/GHSA-g4h2-gqm3-c9wq web
- https://nvd.nist.gov/vuln/detail/CVE-2021-29539 advisory
- https://github.com/tensorflow/tensorflow/commit/4f663d4b8f0bec1b48da6fa091a7d29609980fa4 web
- https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-cpu/PYSEC-2021-467.yaml web
- https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-gpu/PYSEC-2021-665.yaml web
- https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow/PYSEC-2021-176.yaml web
- https://github.com/tensorflow/tensorflow package