CVE-2021-29555: TensorFlow: FusedBatchNorm divide-by-zero crashes ML jobs
MEDIUM PoC AVAILABLEA low-privileged local attacker can crash TensorFlow processes by submitting a zero-dimension tensor to FusedBatchNorm, disrupting training jobs and inference servers. Upgrade to TF 2.5.0 or the patched branch release (2.1.4–2.4.2) immediately. Shared ML platforms and multi-tenant training infrastructure carry the highest exposure.
Risk Assessment
Low-to-moderate risk in isolated single-tenant environments, but elevated in multi-tenant ML platforms where users can submit arbitrary tensor operations. Exploitation is trivial — craft a tensor with last dimension=0 — but requires local or authenticated access, limiting the attack surface. Impact is availability-only; no data exfiltration or code execution is possible. CVSS 5.5 accurately reflects the constrained blast radius. Not in CISA KEV; 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 TF 2.5.0, or apply cherry-picks for 2.4.2, 2.3.3, 2.2.3, or 2.1.4 depending on your supported branch.
-
Input validation: Reject tensors with any zero-valued dimension at API boundaries before they reach tf.raw_ops.
-
Process isolation: Run training and inference workloads in isolated containers or sandboxes to contain crash impact and prevent cross-tenant interference.
-
Detection: Alert on unexpected SIGFPE termination or abnormal process crashes in ML workloads.
-
Audit: Review other tf.raw_ops calls in your codebase for similar unchecked division-by-dimension patterns.
Classification
Compliance Impact
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2021-29555?
A low-privileged local attacker can crash TensorFlow processes by submitting a zero-dimension tensor to FusedBatchNorm, disrupting training jobs and inference servers. Upgrade to TF 2.5.0 or the patched branch release (2.1.4–2.4.2) immediately. Shared ML platforms and multi-tenant training infrastructure carry the highest exposure.
Is CVE-2021-29555 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2021-29555, increasing the risk of exploitation.
How to fix CVE-2021-29555?
1. Patch: Upgrade to TF 2.5.0, or apply cherry-picks for 2.4.2, 2.3.3, 2.2.3, or 2.1.4 depending on your supported branch. 2. Input validation: Reject tensors with any zero-valued dimension at API boundaries before they reach tf.raw_ops. 3. Process isolation: Run training and inference workloads in isolated containers or sandboxes to contain crash impact and prevent cross-tenant interference. 4. Detection: Alert on unexpected SIGFPE termination or abnormal process crashes in ML workloads. 5. Audit: Review other tf.raw_ops calls in your codebase for similar unchecked division-by-dimension patterns.
What systems are affected by CVE-2021-29555?
This vulnerability affects the following AI/ML architecture patterns: training pipelines, model serving, shared ML platforms.
What is the CVSS score for CVE-2021-29555?
CVE-2021-29555 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 via a FPE runtime error in `tf.raw_ops.FusedBatchNorm`. This is because the implementation(https://github.com/tensorflow/tensorflow/blob/828f346274841fa7505f7020e88ca36c22e557ab/tensorflow/core/kernels/fused_batch_norm_op.cc#L295-L297) performs a division based on the last dimension of the `x` tensor. Since this is controlled by the user, an attacker can trigger a denial of service. 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
On a shared ML training platform, a low-privileged user submits a job that calls tf.raw_ops.FusedBatchNorm with a crafted input tensor where the last dimension is 0. TensorFlow executes the division without validation, triggers a SIGFPE, and crashes the process. The attacker repeats this to persistently disrupt co-tenants' training runs, waste GPU quota, and generate alert fatigue in monitoring. No ML expertise is required — the crafted input is trivial to construct. In a TF Serving deployment accepting raw op calls, an authenticated external user could achieve the same result remotely.
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/1a2a87229d1d61e23a39373777c056161eb4084d Patch 3rd Party
- github.com/tensorflow/tensorflow/security/advisories/GHSA-r35g-4525-29fq 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