CVE-2021-29522: TensorFlow: Conv3DBackprop div-by-zero crashes training
MEDIUM PoC AVAILABLEA local attacker with low privileges can crash TensorFlow training jobs by passing empty tensors to Conv3DBackprop operations, aborting long-running compute workloads. Patch immediately to TF 2.5.0, 2.4.2, 2.3.3, 2.2.3, or 2.1.4 — all supported branches have backports available. Risk is confined to availability; no data exfiltration or code execution is possible via this vector.
Risk Assessment
Medium risk overall. Local attack vector with low privilege requirement limits exploitability to insiders or users with system access. Impact is availability-only (A:H), with zero confidentiality or integrity exposure. Risk escalates in shared GPU compute environments or ML-as-a-service platforms where one tenant can disrupt shared training infrastructure. EPSS data unavailable, but the trivial exploit complexity lowers the bar significantly for insider threat scenarios.
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 available backports (2.4.2, 2.3.3, 2.2.3, 2.1.4).
-
Input validation: Assert tensor rank > 0 and all spatial dimensions > 0 before invoking any Conv3DBackprop op — treat this as an API boundary.
-
Isolation: Run training jobs in sandboxed containers with memory/CPU limits to contain crash blast radius.
-
Detection: Monitor for unexpected TF process crashes, SIGFPE signals, or training job aborts with division errors in logs.
-
Shared platforms: Validate and sanitize user-submitted model configs and input tensor shapes at ingestion before execution.
Classification
Compliance Impact
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2021-29522?
A local attacker with low privileges can crash TensorFlow training jobs by passing empty tensors to Conv3DBackprop operations, aborting long-running compute workloads. Patch immediately to TF 2.5.0, 2.4.2, 2.3.3, 2.2.3, or 2.1.4 — all supported branches have backports available. Risk is confined to availability; no data exfiltration or code execution is possible via this vector.
Is CVE-2021-29522 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2021-29522, increasing the risk of exploitation.
How to fix CVE-2021-29522?
1. Patch: Upgrade to TensorFlow ≥2.5.0 or apply available backports (2.4.2, 2.3.3, 2.2.3, 2.1.4). 2. Input validation: Assert tensor rank > 0 and all spatial dimensions > 0 before invoking any Conv3DBackprop op — treat this as an API boundary. 3. Isolation: Run training jobs in sandboxed containers with memory/CPU limits to contain crash blast radius. 4. Detection: Monitor for unexpected TF process crashes, SIGFPE signals, or training job aborts with division errors in logs. 5. Shared platforms: Validate and sanitize user-submitted model configs and input tensor shapes at ingestion before execution.
What systems are affected by CVE-2021-29522?
This vulnerability affects the following AI/ML architecture patterns: training pipelines, distributed training, model serving.
What is the CVSS score for CVE-2021-29522?
CVE-2021-29522 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. The `tf.raw_ops.Conv3DBackprop*` operations fail to validate that the input tensors are not empty. In turn, this would result in a division by 0. This is because the implementation(https://github.com/tensorflow/tensorflow/blob/a91bb59769f19146d5a0c20060244378e878f140/tensorflow/core/kernels/conv_grad_ops_3d.cc#L430-L450) does not check that the divisor used in computing the shard size is not zero. Thus, if attacker controls the input sizes, they can trigger a denial of service via a division by zero error. 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 cluster access (shared ML compute user, compromised CI/CD runner, or malicious ML engineer) submits a TensorFlow training job passing an empty tensor (shape=[0, H, W, D, C]) to tf.raw_ops.Conv3DBackpropFilter. TensorFlow computes shard sizes by dividing by the tensor batch dimension (zero), triggering SIGFPE and killing the process immediately. On a shared Kubernetes training cluster, this aborts any co-located training pod sharing the node. In fine-tuning API services that accept user-supplied training data, a remote attacker could trigger this via a crafted API payload to repeatedly abort incremental training runs, degrading model quality and forcing costly recompute.
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/311403edbc9816df80274bd1ea8b3c0c0f22c3fa Patch 3rd Party
- github.com/tensorflow/tensorflow/security/advisories/GHSA-c968-pq7h-7fxv 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