CVE-2021-29618: TensorFlow: DoS crash via tf.transpose complex+conjugate
MEDIUM PoC AVAILABLEThis is a local denial-of-service vulnerability in TensorFlow that crashes the process when tf.transpose receives a complex tensor alongside conjugate=True. No data exfiltration or code execution is possible, but in shared ML environments (JupyterHub, MLflow, multi-tenant training clusters), a low-privileged user can intentionally crash workloads. Patch to TF 2.5.0, 2.4.2, 2.3.3, 2.2.3, or 2.1.4 immediately if running affected versions in shared or production environments.
Risk Assessment
Medium risk overall, but context-dependent. Exploitation is trivial—any authenticated local user can crash a TensorFlow process with a single API call. The blast radius is limited to availability: no confidentiality or integrity impact. Risk escalates significantly in multi-tenant ML platforms where process crashes can disrupt co-running training jobs, corrupt checkpoint state, or degrade model serving SLAs. Not exploitable remotely without an adjacent code execution primitive.
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-
Upgrade TensorFlow to 2.5.0 or apply the backport patches: 2.4.2, 2.3.3, 2.2.3, 2.1.4.
-
If immediate patching is not possible, add an input validation layer to reject or flag requests combining complex dtype tensors with conjugate=True before they reach tf.transpose.
-
In multi-tenant environments, isolate TensorFlow workers per user to contain blast radius.
-
Monitor for unexpected TensorFlow process restarts or OOM/crash signals in serving infrastructure logs as a detection signal.
-
Pin TF versions in Docker images and CI pipelines to patched builds.
Classification
Compliance Impact
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2021-29618?
This is a local denial-of-service vulnerability in TensorFlow that crashes the process when tf.transpose receives a complex tensor alongside conjugate=True. No data exfiltration or code execution is possible, but in shared ML environments (JupyterHub, MLflow, multi-tenant training clusters), a low-privileged user can intentionally crash workloads. Patch to TF 2.5.0, 2.4.2, 2.3.3, 2.2.3, or 2.1.4 immediately if running affected versions in shared or production environments.
Is CVE-2021-29618 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2021-29618, increasing the risk of exploitation.
How to fix CVE-2021-29618?
1. Upgrade TensorFlow to 2.5.0 or apply the backport patches: 2.4.2, 2.3.3, 2.2.3, 2.1.4. 2. If immediate patching is not possible, add an input validation layer to reject or flag requests combining complex dtype tensors with conjugate=True before they reach tf.transpose. 3. In multi-tenant environments, isolate TensorFlow workers per user to contain blast radius. 4. Monitor for unexpected TensorFlow process restarts or OOM/crash signals in serving infrastructure logs as a detection signal. 5. Pin TF versions in Docker images and CI pipelines to patched builds.
What systems are affected by CVE-2021-29618?
This vulnerability affects the following AI/ML architecture patterns: training pipelines, model serving, jupyter notebooks, batch inference.
What is the CVSS score for CVE-2021-29618?
CVE-2021-29618 has a CVSS v3.1 base score of 5.5 (MEDIUM). The EPSS exploitation probability is 0.02%.
Technical Details
NVD Description
TensorFlow is an end-to-end open source platform for machine learning. Passing a complex argument to `tf.transpose` at the same time as passing `conjugate=True` argument results in a crash. 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 local access to a shared ML platform (e.g., a data scientist account on a JupyterHub cluster or a rogue notebook job on SageMaker) submits a minimal script: `import tensorflow as tf; import numpy as np; x = tf.constant(np.array([1+2j]), dtype=tf.complex64); tf.transpose(x, conjugate=True)`. This immediately crashes the TensorFlow kernel or worker process. On a shared inference server, an adversary with API access to a model endpoint that internally calls tf.transpose on complex inputs could trigger repeated crashes to degrade availability—effectively a low-cost DoS against ML infrastructure without any exploit sophistication.
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/issues/42105 Broken Link
- github.com/tensorflow/issues/46973 Broken Link
- github.com/tensorflow/tensorflow/commit/1dc6a7ce6e0b3e27a7ae650bfc05b195ca793f88 Patch 3rd Party
- github.com/tensorflow/tensorflow/security/advisories/GHSA-xqfj-cr6q-pc8w 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