CVE-2021-29555: TensorFlow: FusedBatchNorm divide-by-zero crashes ML jobs

MEDIUM PoC AVAILABLE
Published May 14, 2021
CISO Take

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.

What is the risk?

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.

What systems are affected?

Package Ecosystem Vulnerable Range Patched
TensorFlow pip No patch
195.8K OpenSSF 7.1 3.7K dependents Pushed 3d ago 4% patched ~1372d to patch Full package profile →

Do you use TensorFlow? You're affected.

How severe is it?

CVSS 3.1
5.5 / 10
EPSS
0.2%
chance of exploitation in 30 days
Higher than 9% of all CVEs
Exploitation Status
Exploit Available
Exploitation: MEDIUM
Sophistication
Trivial
Exploitation Confidence
medium
Public PoC indexed (trickest/cve)
Composite signal derived from CISA KEV, VulnCheck KEV, CISA SSVC, EPSS, Metasploit, Exploit-DB, trickest/cve, Nuclei templates, and inthewild.io exploitation reports.

What is the attack surface?

AV AC PR UI S C I A
AV Local
AC Low
PR Low
UI None
S Unchanged
C None
I None
A High

What should I do?

5 steps
  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.

How is it classified?

Which compliance frameworks are affected?

This CVE is relevant to:

EU AI Act
Art. 9 - Risk management system
ISO 42001
A.10.3 - AI system availability and reliability
NIST AI RMF
MANAGE 2.4 - Residual risks are managed
OWASP LLM Top 10
LLM03 - Supply Chain Vulnerabilities

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.19%.

What is the AI security impact?

Affected AI Architectures

training pipelinesmodel servingshared ML platforms

MITRE ATLAS Techniques

AML.T0010.001 AI Software
AML.T0029 Denial of AI Service
AML.T0049 Exploit Public-Facing Application

Compliance Controls Affected

EU AI Act: Art. 9
ISO 42001: A.10.3
NIST AI RMF: MANAGE 2.4
OWASP LLM Top 10: LLM03

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 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)

CWE-369 — Divide By Zero: The product divides a value by zero.

Source: MITRE CWE corpus.

CVSS Vector

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

Timeline

Published
May 14, 2021
Last Modified
November 21, 2024
First Seen
May 14, 2021

Related Vulnerabilities