CVE-2021-29563: TensorFlow: DoS via RFFT empty matrix assertion crash
MEDIUMPoC 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.
What is the risk?
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.
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 stepsPatch: 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.
How is it classified?
Which compliance frameworks are affected?
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.19%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0010.001AI SoftwareAML.T0029Denial of AI ServiceAML.T0049Exploit Public-Facing ApplicationCompliance Controls Affected
What are the technical details?
Original Advisory
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)
CWE-617 — Reachable Assertion: The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.
- [Implementation] If the assertion statement is required (e.g., for security or reliability), change the invoking code to avoid the conditions that trigger the assertion.
- [Implementation] Consider changing the assertion to some other less "fatal" error. This might not be easy to implement, since other code may be needed to handle the error.
Source: MITRE CWE corpus.
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:HReferences
Timeline
Related Vulnerabilities
CVE-2026-189489.9Feast: insecure UDF deserialization enables RCE
Same package: tensorflowCVE-2020-151969.9TensorFlow: heap OOB read in sparse/ragged count ops
Same package: tensorflowCVE-2020-152059.8TensorFlow: heap overflow in StringNGrams, ASLR bypass
Same package: tensorflowCVE-2019-167789.8TensorFlow: heap overflow in UnsortedSegmentSum op
Same package: tensorflowCVE-2020-152089.8TFLite: OOB read/write via tensor dimension mismatch
Same package: tensorflow