CVE-2021-29563: TensorFlow: DoS via RFFT empty matrix assertion crash
MEDIUM PoC AVAILABLEA low-privileged local attacker can crash any TensorFlow process by passing an empty matrix to the RFFT operation, terminating ML workers or inference servers. Patch immediately to TF 2.5.0 or available backports (2.4.2, 2.3.3, 2.2.3, 2.1.4). In shared ML environments (Jupyter hubs, MLflow, SageMaker notebooks), this is a viable insider or multi-tenant disruption vector.
Risk Assessment
Medium risk overall, but elevated in multi-tenant ML platforms. The local attack vector (AV:L) limits exposure for standalone deployments, but shared compute environments—where multiple users or workloads share a TensorFlow process or ML inference server—make this trivially exploitable. No confidentiality or integrity impact; availability is fully compromised for the affected process. Not in CISA KEV and no evidence of active exploitation.
Affected Systems
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| tensorflow | pip | — | No patch |
Do you use tensorflow? You're affected.
Severity & Risk
Attack Surface
Recommended Action
5 steps-
Patch: Upgrade to TensorFlow 2.5.0 or apply cherrypicks to 2.4.2, 2.3.3, 2.2.3, or 2.1.4. Reference commit: 31bd5026304677faa8a0b77602c6154171b9aec1.
-
Validate inputs: Add shape assertions before any RFFT call—reject empty tensors at the application layer.
-
Isolate workloads: Run untrusted or user-submitted TF graphs in sandboxed processes (separate containers or VMs) to contain crash blast radius.
-
Monitor: Alert on unexpected TensorFlow process exits in ML workers/serving infrastructure.
-
Audit exposure: Identify any public-facing APIs that accept user-controlled tensors passed to FFT operations.
Classification
Compliance Impact
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2021-29563?
A low-privileged local attacker can crash any TensorFlow process by passing an empty matrix to the RFFT operation, terminating ML workers or inference servers. Patch immediately to TF 2.5.0 or available backports (2.4.2, 2.3.3, 2.2.3, 2.1.4). In shared ML environments (Jupyter hubs, MLflow, SageMaker notebooks), this is a viable insider or multi-tenant disruption vector.
Is CVE-2021-29563 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2021-29563, increasing the risk of exploitation.
How to fix CVE-2021-29563?
1. Patch: Upgrade to TensorFlow 2.5.0 or apply cherrypicks to 2.4.2, 2.3.3, 2.2.3, or 2.1.4. Reference commit: 31bd5026304677faa8a0b77602c6154171b9aec1. 2. Validate inputs: Add shape assertions before any RFFT call—reject empty tensors at the application layer. 3. Isolate workloads: Run untrusted or user-submitted TF graphs in sandboxed processes (separate containers or VMs) to contain crash blast radius. 4. Monitor: Alert on unexpected TensorFlow process exits in ML workers/serving infrastructure. 5. Audit exposure: Identify any public-facing APIs that accept user-controlled tensors passed to FFT operations.
What systems are affected by CVE-2021-29563?
This vulnerability affects the following AI/ML architecture patterns: training pipelines, model serving, ML notebooks, batch inference pipelines, audio/signal preprocessing.
What is the CVSS score for CVE-2021-29563?
CVE-2021-29563 has a CVSS v3.1 base score of 5.5 (MEDIUM). The EPSS exploitation probability is 0.01%.
Technical Details
NVD Description
TensorFlow is an end-to-end open source platform for machine learning. An attacker can cause a denial of service by exploiting a `CHECK`-failure coming from the implementation of `tf.raw_ops.RFFT`. Eigen code operating on an empty matrix can trigger on an assertion and will cause program termination. 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 attacker with authenticated access to a shared ML notebook environment (e.g., JupyterHub, Databricks, SageMaker Studio) imports TensorFlow and calls tf.raw_ops.RFFT with an empty input tensor. This triggers an Eigen assertion failure that terminates the Python kernel or TF serving process—disrupting other users sharing the same runtime. In a model-serving context, an adversary who can submit inference requests containing crafted empty inputs to an endpoint backed by TF RFFT operations achieves remote process termination, causing service outage.
Weaknesses (CWE)
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/31bd5026304677faa8a0b77602c6154171b9aec1 Patch 3rd Party
- github.com/tensorflow/tensorflow/security/advisories/GHSA-ph87-fvjr-v33w 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
AI Threat Alert