Skip to content
TensorFlowGHSA-g4h2-gqm3-c9wq

Segfault in tf.raw_ops.ImmutableConst

Low2.5CVE-2021-29539 · Published May 21, 2021 · updated Jul 8, 2026

### Impact 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. ```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](https://github.com/tensorflow/tensorflow/blob/master/SECURITY.md) for more information regarding the security model and how to contact us with issues and questions.

GitHub advisory

Affected versions

PackageAffectedFixed in
tensorflow
PyPI
< 2.1.42.1.4
>= 2.2.0, < 2.2.32.2.3
>= 2.3.0, < 2.3.32.3.3
>= 2.4.0, < 2.4.22.4.2
Details and references

More TensorFlow advisories

All TensorFlow
Advisory
Segfault in `tf.raw_ops.SparseCountSparseOutput`
Low2.5May 21, 2021
Crash in `tf.transpose` with complex inputs
Low2.5May 21, 2021
Crash in `tf.strings.substr` due to `CHECK`-fail
Low2.5May 21, 2021
Null dereference in Grappler's `TrySimplify`
Low2.5May 21, 2021
Stack overflow in `ParseAttrValue` with nested tensors
Low2.5May 21, 2021
Interpreter crash from `tf.io.decode_raw`
Medium7.1May 21, 2021

Critical advisories by email

Wednesdays: the week’s critical and high advisories in the AI and data stack, with the fixed versions. Only in weeks that have some.

Double opt-in. Unsubscribe any time.