CVE-2021-29527: TensorFlow: divide-by-zero DoS in QuantizedConv2D
MEDIUM PoC AVAILABLEA 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.
Risk Assessment
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.
Affected Systems
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| tensorflow | pip | — | No patch |
Do you use tensorflow? You're affected.
Severity & Risk
Attack Surface
Recommended Action
4 steps-
Patch: Upgrade to TensorFlow 2.5.0, 2.4.2, 2.3.3, 2.2.3, or 2.1.4 — all contain the fix.
-
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.
-
Access control: Restrict access to tf.raw_ops in multi-tenant environments using job isolation, containerization, or sandboxing to prevent cross-tenant disruption.
-
Detection: Monitor for SIGFPE/SIGABRT crashes in TF worker processes and alert on unexpected model evaluation failures involving QuantizedConv2D ops.
Classification
Compliance Impact
This CVE is relevant to:
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.01%.
Technical Details
NVD Description
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)
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/cfa91be9863a91d5105a3b4941096044ab32036b Patch 3rd Party
- github.com/tensorflow/tensorflow/security/advisories/GHSA-x4g7-fvjj-prg8 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