CVE-2021-29584: TensorFlow: integer overflow DoS in SparseSplit op
MEDIUM PoC AVAILABLEA local attacker with low privileges can crash TensorFlow processes by crafting a SparseSplit operation with oversized tensor dimensions, triggering an integer overflow and CHECK-fail assertion. In shared ML platforms—Jupyter hubs, multi-tenant model servers, or internal AI APIs accepting user-defined ops—this becomes a practical availability threat. Upgrade to TF 2.5.0 or patched backports (2.4.2, 2.3.3, 2.2.3, 2.1.4) immediately; restrict untrusted tensor op submission in shared environments as a compensating control.
What is the risk?
Medium overall, but context-dependent. The CVSS 5.5 score reflects local access requirement, which limits mass exploitation. However, in shared ML infrastructure (multi-tenant Jupyter, internal model serving endpoints, AutoML platforms), 'local access' is often a low bar—any authenticated user or API consumer qualifies. No in-the-wild exploitation recorded, not in CISA KEV. The trivial exploitation mechanics (craft oversized shape dimensions) elevate practical risk above the base score in shared-compute environments.
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| TensorFlow | pip | — | No patch |
Do you use TensorFlow? You're affected.
How severe is it?
What is the attack surface?
What should I do?
5 steps-
PATCH
Upgrade TensorFlow to ≥2.5.0 or apply backports: 2.4.2, 2.3.3, 2.2.3, or 2.1.4. Commit fix: 4c0ee937c0f61c4fc5f5d32d9bb4c67428012a60.
-
VALIDATE INPUT
Add dimension bounds checks before passing user-supplied shapes to SparseSplit; reject requests where shape dimensions exceed safe thresholds.
-
ISOLATE
Run TF model servers in separate processes per user/tenant to contain blast radius of a crash.
-
MONITOR
Alert on abnormal TF process terminations (SIGABRT/CHECK-fail logs) as potential exploitation indicators.
-
DETECT
Search for patterns like extreme tensor dimension values (approaching INT64_MAX) in model serving logs.
How is it classified?
Which compliance frameworks are affected?
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2021-29584?
A local attacker with low privileges can crash TensorFlow processes by crafting a SparseSplit operation with oversized tensor dimensions, triggering an integer overflow and CHECK-fail assertion. In shared ML platforms—Jupyter hubs, multi-tenant model servers, or internal AI APIs accepting user-defined ops—this becomes a practical availability threat. Upgrade to TF 2.5.0 or patched backports (2.4.2, 2.3.3, 2.2.3, 2.1.4) immediately; restrict untrusted tensor op submission in shared environments as a compensating control.
Is CVE-2021-29584 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2021-29584, increasing the risk of exploitation.
How to fix CVE-2021-29584?
1. PATCH: Upgrade TensorFlow to ≥2.5.0 or apply backports: 2.4.2, 2.3.3, 2.2.3, or 2.1.4. Commit fix: 4c0ee937c0f61c4fc5f5d32d9bb4c67428012a60. 2. VALIDATE INPUT: Add dimension bounds checks before passing user-supplied shapes to SparseSplit; reject requests where shape dimensions exceed safe thresholds. 3. ISOLATE: Run TF model servers in separate processes per user/tenant to contain blast radius of a crash. 4. MONITOR: Alert on abnormal TF process terminations (SIGABRT/CHECK-fail logs) as potential exploitation indicators. 5. DETECT: Search for patterns like extreme tensor dimension values (approaching INT64_MAX) in model serving logs.
What systems are affected by CVE-2021-29584?
This vulnerability affects the following AI/ML architecture patterns: training pipelines, model serving, shared ML platforms, notebook environments.
What is the CVSS score for CVE-2021-29584?
CVE-2021-29584 has a CVSS v3.1 base score of 5.5 (MEDIUM). The EPSS exploitation probability is 0.19%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0010.001 AI Software AML.T0029 Denial of AI Service AML.T0049 Exploit Public-Facing Application Compliance Controls Affected
What are the technical details?
Original Advisory
TensorFlow is an end-to-end open source platform for machine learning. An attacker can trigger a denial of service via a `CHECK`-fail in caused by an integer overflow in constructing a new tensor shape. This is because the implementation(https://github.com/tensorflow/tensorflow/blob/0908c2f2397c099338b901b067f6495a5b96760b/tensorflow/core/kernels/sparse_split_op.cc#L66-L70) builds a dense shape without checking that the dimensions would not result in overflow. The `TensorShape` constructor(https://github.com/tensorflow/tensorflow/blob/6f9896890c4c703ae0a0845394086e2e1e523299/tensorflow/core/framework/tensor_shape.cc#L183-L188) uses a `CHECK` operation which triggers when `InitDims`(https://github.com/tensorflow/tensorflow/blob/6f9896890c4c703ae0a0845394086e2e1e523299/tensorflow/core/framework/tensor_shape.cc#L212-L296) returns a non-OK status. This is a legacy implementation of the constructor and operations should use `BuildTensorShapeBase` or `AddDimWithStatus` to prevent `CHECK`-failures in the presence of overflows. The fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2, TensorFlow 2.3.3, TensorFlow 2.2.3 and TensorFlow 2.1.4, as these are also affected and still in supported range.
Exploitation Scenario
An internal data scientist on a shared ML platform submits a SparseSplit operation via a Jupyter notebook with a dense_shape tensor constructed so that multiplying its dimensions causes integer overflow (e.g., shape [9223372036854775807, 2]). TensorShape constructor calls InitDims, which returns a non-OK status due to overflow; the CHECK macro triggers, sending SIGABRT to the TF process. In a shared model-serving scenario, a single crafted API request to an endpoint accepting sparse tensor inputs crashes the serving process, causing a denial of service for all concurrent users. Requires no exploit payload, just knowledge of the overflow condition.
Weaknesses (CWE)
CWE-190 — Integer Overflow or Wraparound: The product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. This occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may become a very small or negative number.
- [Requirements] Ensure that all protocols are strictly defined, such that all out-of-bounds behavior can be identified simply, and require strict conformance to the protocol.
- [Requirements] Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. If possible, choose a language or compiler that performs automatic bounds checking.
Source: MITRE CWE corpus.
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H References
- github.com/tensorflow/tensorflow/commit/4c0ee937c0f61c4fc5f5d32d9bb4c67428012a60 Patch 3rd Party
- github.com/tensorflow/tensorflow/security/advisories/GHSA-xvjm-fvxx-q3hv Exploit Patch 3rd Party
Timeline
Related Vulnerabilities
CVE-2020-15196 9.9 TensorFlow: heap OOB read in sparse/ragged count ops
Same package: tensorflow CVE-2020-15205 9.8 TensorFlow: heap overflow in StringNGrams, ASLR bypass
Same package: tensorflow CVE-2020-15208 9.8 TFLite: OOB read/write via tensor dimension mismatch
Same package: tensorflow CVE-2019-16778 9.8 TensorFlow: heap overflow in UnsortedSegmentSum op
Same package: tensorflow CVE-2022-23587 9.8 TensorFlow: integer overflow in Grappler enables RCE
Same package: tensorflow