CVE-2021-41195: Crash in `tf.math.segment_*` operations
5.5
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.10439%
CWE
Published
11/10/2021
Updated
11/13/2024
KEV Status
No
Technology
Python
Technical Details
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
tensorflow | pip | >= 2.6.0, < 2.6.1 | 2.6.1 |
tensorflow | pip | >= 2.5.0, < 2.5.2 | 2.5.2 |
tensorflow | pip | < 2.4.4 | 2.4.4 |
tensorflow-cpu | pip | >= 2.6.0, < 2.6.1 | 2.6.1 |
tensorflow-cpu | pip | >= 2.5.0, < 2.5.2 | 2.5.2 |
tensorflow-cpu | pip | < 2.4.4 | 2.4.4 |
tensorflow-gpu | pip | >= 2.6.0, < 2.6.1 | 2.6.1 |
tensorflow-gpu | pip | >= 2.5.0, < 2.5.2 | 2.5.2 |
tensorflow-gpu | pip | < 2.4.4 | 2.4.4 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from the use of TensorShape::set_dim (which internally uses AddDim) in segment reduction operations. AddDim lacks overflow checks and triggers a fatal CHECK failure when segment_ids produce large output dimensions. The patched commit explicitly replaces set_dim with SetDimWithStatus (which uses AddDimWithStatus) in both CPU and GPU implementations in segment_reduction_ops_impl.h, confirming these functions as the vulnerable points. The affected code paths are directly identified in the provided diff.