CVE-2021-29548: TensorFlow: DoS via division by zero in QuantizedBatchNorm

MEDIUM PoC AVAILABLE
Published May 14, 2021
CISO Take

Medium-severity DoS in TensorFlow's quantized batch normalization op — exploitable locally with low privileges by passing inputs that violate the op contract. Patch to TF 2.5.0 or the cherrypick backports (2.1.4/2.2.3/2.3.3/2.4.2); no workaround exists short of input validation. Elevated concern in shared ML clusters or Jupyter environments where co-tenants can trigger model ops.

What is the risk?

Medium risk overall, but contextually higher in multi-tenant ML platforms. CVSS 5.5 (local, low-privilege, availability-only) understates the blast radius in shared inference serving infrastructure where a single crashed TF process can disrupt all co-hosted workloads. No confidentiality or integrity exposure. Not actively exploited (not in KEV). Patching is straightforward — risk window is short for teams with disciplined dependency management.

What systems are affected?

Package Ecosystem Vulnerable Range Patched
TensorFlow pip No patch
195.8K OpenSSF 7.1 3.7K dependents Pushed 2d 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 TensorFlow ≥2.5.0 or apply cherrypick backports: 2.1.4, 2.2.3, 2.3.3, 2.4.2. Verify via pip show tensorflow.

  2. Input validation: if upgrade is not immediately feasible, validate that the variance tensor passed to QuantizedBatchNormWithGlobalNormalization contains no zero values before op invocation.

  3. Isolation: in shared environments, run each tenant's TF workload in a separate process/container to contain crash impact.

  4. Detection: alert on unexpected TF runtime segfaults or OOM-killer events in ML workload logs — repeated crashes from the same op are an indicator.

  5. Audit: scan requirements.txt / conda envs across the ML platform for affected TF versions.

How is it classified?

Which compliance frameworks are affected?

This CVE is relevant to:

EU AI Act
Article 15 - Accuracy, robustness and cybersecurity
ISO 42001
A.6.2.6 - AI system robustness and reliability
NIST AI RMF
MANAGE-2.2 - Mechanisms exist to support the management of identified AI risks
OWASP LLM Top 10
LLM05:2025 - Insecure Plugin/Supply Chain

Frequently Asked Questions

What is CVE-2021-29548?

Medium-severity DoS in TensorFlow's quantized batch normalization op — exploitable locally with low privileges by passing inputs that violate the op contract. Patch to TF 2.5.0 or the cherrypick backports (2.1.4/2.2.3/2.3.3/2.4.2); no workaround exists short of input validation. Elevated concern in shared ML clusters or Jupyter environments where co-tenants can trigger model ops.

Is CVE-2021-29548 actively exploited?

Proof-of-concept exploit code is publicly available for CVE-2021-29548, increasing the risk of exploitation.

How to fix CVE-2021-29548?

1. Patch: upgrade to TensorFlow ≥2.5.0 or apply cherrypick backports: 2.1.4, 2.2.3, 2.3.3, 2.4.2. Verify via `pip show tensorflow`. 2. Input validation: if upgrade is not immediately feasible, validate that the variance tensor passed to QuantizedBatchNormWithGlobalNormalization contains no zero values before op invocation. 3. Isolation: in shared environments, run each tenant's TF workload in a separate process/container to contain crash impact. 4. Detection: alert on unexpected TF runtime segfaults or OOM-killer events in ML workload logs — repeated crashes from the same op are an indicator. 5. Audit: scan requirements.txt / conda envs across the ML platform for affected TF versions.

What systems are affected by CVE-2021-29548?

This vulnerability affects the following AI/ML architecture patterns: model serving, training pipelines, edge inference.

What is the CVSS score for CVE-2021-29548?

CVE-2021-29548 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

model servingtraining pipelinesedge inference

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: Article 15
ISO 42001: A.6.2.6
NIST AI RMF: MANAGE-2.2
OWASP LLM Top 10: LLM05:2025

What are the technical details?

Original Advisory

TensorFlow is an end-to-end open source platform for machine learning. An attacker can cause a runtime division by zero error and denial of service in `tf.raw_ops.QuantizedBatchNormWithGlobalNormalization`. This is because the implementation(https://github.com/tensorflow/tensorflow/blob/55a97caa9e99c7f37a0bbbeb414dc55553d3ae7f/tensorflow/core/kernels/quantized_batch_norm_op.cc) does not validate all constraints specified in the op's contract(https://www.tensorflow.org/api_docs/python/tf/raw_ops/QuantizedBatchNormWithGlobalNormalization). 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 adversary with access to a shared ML training cluster (e.g., a rogue data scientist, compromised notebook, or malicious ML job submitted to a shared queue) crafts a TF computation graph that calls `tf.raw_ops.QuantizedBatchNormWithGlobalNormalization` with a zero-value variance tensor. When executed, the TF runtime performs an unchecked division by zero, throws a runtime error, and crashes the entire TF process. On a shared TF Serving deployment, this kills inference for all models hosted in the same process. The attacker can repeat the request to maintain the DoS, preventing recovery. No elevated privileges or ML expertise required — the op is directly accessible via the raw_ops API.

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