CVE-2021-29527: TensorFlow: divide-by-zero DoS in QuantizedConv2D

MEDIUM PoC AVAILABLE
Published May 14, 2021
CISO Take

A local attacker with low privileges can crash any TensorFlow process by passing a zero-value divisor to QuantizedConv2D, causing a denial of service. Patch to TF 2.5.0 or the applicable backport (2.4.2, 2.3.3, 2.2.3, 2.1.4) immediately across all training and inference infrastructure. Risk is elevated in shared ML platforms and MLOps pipelines where multiple users submit jobs to a common environment.

What is the risk?

Medium risk overall, but elevated in multi-tenant ML environments. Local-only exploitation limits remote attack surface, and exploitation requires minimal skill—just crafting a raw op call with a zero-value parameter. No confidentiality or integrity impact; availability of ML workloads is the sole concern. The real threat is disruption of shared training infrastructure where a single low-privileged user can crash processes affecting all tenants.

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?

4 steps
  1. Patch: Upgrade to TensorFlow 2.5.0, 2.4.2, 2.3.3, 2.2.3, or 2.1.4 — all contain the fix.

  2. Input validation: Ensure caller-supplied range parameters to QuantizedConv2D (min_input, max_input, min_filter, max_filter) cannot produce a zero divisor before reaching the kernel.

  3. Access control: Restrict access to tf.raw_ops in multi-tenant environments using job isolation, containerization, or sandboxing to prevent cross-tenant disruption.

  4. Detection: Monitor for SIGFPE/SIGABRT crashes in TF worker processes and alert on unexpected model evaluation failures involving QuantizedConv2D ops.

How is it classified?

Which compliance frameworks are affected?

This CVE is relevant to:

EU AI Act
Art. 15 - Accuracy, Robustness and Cybersecurity
ISO 42001
8.4 - AI System Availability and Resilience
NIST AI RMF
MANAGE-2.2 - Risks or Incidents Are Responded to and Recovered From
OWASP LLM Top 10
LLM03 - Supply Chain Vulnerabilities

Frequently Asked Questions

What is CVE-2021-29527?

A local attacker with low privileges can crash any TensorFlow process by passing a zero-value divisor to QuantizedConv2D, causing a denial of service. Patch to TF 2.5.0 or the applicable backport (2.4.2, 2.3.3, 2.2.3, 2.1.4) immediately across all training and inference infrastructure. Risk is elevated in shared ML platforms and MLOps pipelines where multiple users submit jobs to a common environment.

Is CVE-2021-29527 actively exploited?

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

How to fix CVE-2021-29527?

1. Patch: Upgrade to TensorFlow 2.5.0, 2.4.2, 2.3.3, 2.2.3, or 2.1.4 — all contain the fix. 2. Input validation: Ensure caller-supplied range parameters to QuantizedConv2D (min_input, max_input, min_filter, max_filter) cannot produce a zero divisor before reaching the kernel. 3. Access control: Restrict access to tf.raw_ops in multi-tenant environments using job isolation, containerization, or sandboxing to prevent cross-tenant disruption. 4. Detection: Monitor for SIGFPE/SIGABRT crashes in TF worker processes and alert on unexpected model evaluation failures involving QuantizedConv2D ops.

What systems are affected by CVE-2021-29527?

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

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

CVE-2021-29527 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 servinginference

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. 15
ISO 42001: 8.4
NIST AI RMF: MANAGE-2.2
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 trigger a division by 0 in `tf.raw_ops.QuantizedConv2D`. This is because the implementation(https://github.com/tensorflow/tensorflow/blob/00e9a4d67d76703fa1aee33dac582acf317e0e81/tensorflow/core/kernels/quantized_conv_ops.cc#L257-L259) does a division by a quantity that is controlled by the caller. 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 data scientist on a multi-tenant Kubeflow deployment, or a malicious model contributor in an automated MLOps pipeline) submits a TensorFlow job that calls tf.raw_ops.QuantizedConv2D with min_input equal to max_input, producing a zero divisor in the kernel's range normalization step. This immediately crashes the TF process — potentially taking down a shared parameter server, disrupting co-located training runs, or blocking an automated model validation gate in a CI/CD pipeline before a production deployment.

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