{"id":"CVE-2021-41195","published":"2021-11-05T19:50:12Z","modified":"2024-08-04T03:08:31Z","title":"Crash in `tf.math.segment_*` operations","vendor":"tensorflow","product":"tensorflow","tier":"tail","description":{"text":"TensorFlow is an open source platform for machine learning. In affected versions the implementation of `tf.math.segment_*` operations results in a `CHECK`-fail related abort (and denial of service) if a segment id in `segment_ids` is large. This is similar to CVE-2021-29584 (and similar other reported vulnerabilities in TensorFlow, localized to specific APIs): the implementation (both on CPU and GPU) computes the output shape using `AddDim`. However, if the number of elements in the tensor overflows an `int64_t` value, `AddDim` results in a `CHECK` failure which provokes a `std::abort`. Instead, code should use `AddDimWithStatus`. The fix will be included in TensorFlow 2.7.0. We will also cherrypick this commit on TensorFlow 2.6.1, TensorFlow 2.5.2, and TensorFlow 2.4.4, as these are also affected and still in supported range.","provenance":"source","from":"CVE.org"},"cvss":{"score":5.5,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00212,"percentile":0.06535,"provenance":"source"},"cwes":[{"id":"CWE-190","name":"Integer Overflow or Wraparound"}],"references":[{"url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-cq76-mxrc-vchh","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/tensorflow/tensorflow/issues/46888","tags":["x_refsource_MISC"]},{"url":"https://github.com/tensorflow/tensorflow/pull/51733","tags":["x_refsource_MISC"]},{"url":"https://github.com/tensorflow/tensorflow/commit/e9c81c1e1a9cd8dd31f4e83676cab61b60658429","tags":["x_refsource_MISC"]}],"priority":{"score":5.2,"factors":[{"name":"EPSS percentile","points":1.31},{"name":"CVSS severity","points":3.85}]},"vendorSlug":"tensorflow","affectedVersions":[{"vendor":"tensorflow","product":"tensorflow","versions":[">= 2.6.0, < 2.6.1",">= 2.5.0, < 2.5.2","< 2.4.4"]}],"affected":[{"ecosystem":"PyPI","package":"tensorflow","vulnerableRanges":[">=2.6.0, <2.6.1",">=2.5.0, <2.5.2","<2.4.4"],"patched":["2.6.1","2.5.2","2.4.4"],"from":["GHSA-cq76-mxrc-vchh","PYSEC-2021-842"],"provenance":"source"},{"ecosystem":"PyPI","package":"tensorflow-cpu","vulnerableRanges":[">=2.6.0, <2.6.1",">=2.5.0, <2.5.2","<2.4.4"],"patched":["2.6.1","2.5.2","2.4.4"],"from":["GHSA-cq76-mxrc-vchh","PYSEC-2021-844"],"provenance":"source"},{"ecosystem":"PyPI","package":"tensorflow-gpu","vulnerableRanges":[">=2.6.0, <2.6.1",">=2.5.0, <2.5.2","<2.4.4"],"patched":["2.6.1","2.5.2","2.4.4"],"from":["GHSA-cq76-mxrc-vchh","PYSEC-2021-846"],"provenance":"source"}],"summary":{"text":"The tensorflow package's tf.math.segment_* operations, on both CPU and GPU, compute their output shape with an AddDim call that aborts the process when the element count overflows a 64-bit integer when a large segment id appears in segment_ids. An attacker who can get a local user to run a crafted input through these operations, with no privileges or user interaction needed beyond that, can crash the process and cause a denial of service.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:17:48Z"},"euvd":{"id":"EUVD-2021-0451","exploited":false,"provenance":"source"},"lineage":{"parents":[{"from":"CVE-2021-29584","to":"CVE-2021-41195","relation":"related","confidence":"low","kind":"lineage","evidence":[{"kind":"text","provenance":"source","relation":"related","quote":"This is similar to CVE-2021-29584 (and similar other reported vulnerabilities in TensorFlow, localized to specific APIs): the implementation (both on CPU and GPU) computes the output shape using `AddDim`.","from":"CVE.org","in":"CVE-2021-41195"}]}]}}