{"id":"CVE-2021-29539","aliases":["BIT-tensorflow-2021-29539","GHSA-g4h2-gqm3-c9wq","PYSEC-2021-176","PYSEC-2021-467","PYSEC-2021-665"],"url":"https://o3.security/vulnerability/CVE-2021-29539","summary":"Segfault in tf.raw_ops.ImmutableConst","details":"### Impact\nCalling [`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.\n\n```python\n>>> import tensorflow as tf\n>>> tf.raw_ops.ImmutableConst(dtype=tf.resource, shape=[], memory_region_name=\"/tmp/test.txt\")\n...\nSegmentation fault\n```\n\n### Patches\nWe 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.\n\n### Workarounds\nIf using `tf.raw_ops.ImmutableConst` in code, you can prevent the segfault by inserting a filter for the `dtype` argument.\n\n### For more information\nPlease 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.","published":"2021-05-14T20:15:12.397Z","modified":"2026-08-07T16:49:55.434166Z","cvss":{"score":5.5,"severity":"MEDIUM","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H"},"epss":null,"cisaKev":null,"exploitsKnown":null,"affectedPackages":[{"ecosystem":"PyPI","name":"tensorflow","fixedVersion":"2.1.4"},{"ecosystem":"PyPI","name":"tensorflow","fixedVersion":"2.2.3"},{"ecosystem":"PyPI","name":"tensorflow","fixedVersion":"2.3.3"},{"ecosystem":"PyPI","name":"tensorflow","fixedVersion":"2.4.2"},{"ecosystem":"PyPI","name":"tensorflow-cpu","fixedVersion":"2.1.4"},{"ecosystem":"PyPI","name":"tensorflow-cpu","fixedVersion":"2.2.3"},{"ecosystem":"PyPI","name":"tensorflow-cpu","fixedVersion":"2.3.3"},{"ecosystem":"PyPI","name":"tensorflow-cpu","fixedVersion":"2.4.2"},{"ecosystem":"PyPI","name":"tensorflow-gpu","fixedVersion":"2.1.4"},{"ecosystem":"PyPI","name":"tensorflow-gpu","fixedVersion":"2.2.3"},{"ecosystem":"PyPI","name":"tensorflow-gpu","fixedVersion":"2.3.3"},{"ecosystem":"PyPI","name":"tensorflow-gpu","fixedVersion":"2.4.2"}],"fix":{"url":"https://github.com/tensorflow/tensorflow/commit/4f663d4b8f0bec1b48da6fa091a7d29609980fa4","label":"tensorflow/tensorflow@4f663d4"},"references":[{"type":"FIX","url":"https://github.com/tensorflow/tensorflow/commit/4f663d4b8f0bec1b48da6fa091a7d29609980fa4"},{"type":"FIX","url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-g4h2-gqm3-c9wq"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-29539"},{"type":"WEB","url":"https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-cpu/PYSEC-2021-467.yaml"},{"type":"WEB","url":"https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-gpu/PYSEC-2021-665.yaml"},{"type":"WEB","url":"https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow/PYSEC-2021-176.yaml"},{"type":"PACKAGE","url":"https://github.com/tensorflow/tensorflow"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-07T16:49:55.434166Z"}}