CVE-2021-29525: TensorFlow: div-by-zero DoS in Conv2DBackpropInput
HIGH PoC AVAILABLEA divide-by-zero in TensorFlow's Conv2DBackpropInput allows a local low-privilege attacker to crash training workers or TF serving processes. The CVSS 7.8 overstates practical risk for isolated deployments — the real exposure is multi-tenant ML infrastructure where untrusted users share TensorFlow workers. Patch to TF 2.5.0 or apply cherrypicks to your supported branch; prioritize shared training clusters and Jupyter environments over single-user workstations.
Risk Assessment
CVSS 7.8 HIGH overstates real-world risk for most deployments due to the local attack vector (AV:L). Exploitation requires code execution on the target system or the ability to submit TensorFlow operations — this narrows exposure to multi-tenant ML platforms (Kubeflow, JupyterHub, SageMaker shared clusters). The C:H/I:H/A:H impact scores reflect worst-case crash scenarios in C++ that may allow memory corruption beyond a clean DoS. Not in CISA KEV; no evidence of active exploitation. Risk is MEDIUM for isolated deployments, HIGH for shared multi-tenant training infrastructure.
Affected Systems
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| tensorflow | pip | — | No patch |
Do you use tensorflow? You're affected.
Severity & Risk
Attack Surface
Recommended Action
6 steps-
Patch: upgrade to TensorFlow 2.5.0 (primary fix) or apply cherrypicks to TF 2.4.2, 2.3.3, 2.2.3, or 2.1.4.
-
Audit current TF versions across all environments:
pip freeze | grep -i tensorflowand check ML container base images. -
In multi-tenant platforms, enforce resource isolation so a crashing TF worker cannot disrupt co-tenant jobs.
-
Add input validation on Conv2D stride/padding parameters before they reach TF kernels if upgrading immediately is not feasible.
-
Monitor training job abnormal termination rates as an anomaly signal.
-
Scan infrastructure-as-code and ML pipeline Docker images for vulnerable TF versions via OSS dependency scanners (Trivy, Grype).
Classification
Compliance Impact
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2021-29525?
A divide-by-zero in TensorFlow's Conv2DBackpropInput allows a local low-privilege attacker to crash training workers or TF serving processes. The CVSS 7.8 overstates practical risk for isolated deployments — the real exposure is multi-tenant ML infrastructure where untrusted users share TensorFlow workers. Patch to TF 2.5.0 or apply cherrypicks to your supported branch; prioritize shared training clusters and Jupyter environments over single-user workstations.
Is CVE-2021-29525 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2021-29525, increasing the risk of exploitation.
How to fix CVE-2021-29525?
1. Patch: upgrade to TensorFlow 2.5.0 (primary fix) or apply cherrypicks to TF 2.4.2, 2.3.3, 2.2.3, or 2.1.4. 2. Audit current TF versions across all environments: `pip freeze | grep -i tensorflow` and check ML container base images. 3. In multi-tenant platforms, enforce resource isolation so a crashing TF worker cannot disrupt co-tenant jobs. 4. Add input validation on Conv2D stride/padding parameters before they reach TF kernels if upgrading immediately is not feasible. 5. Monitor training job abnormal termination rates as an anomaly signal. 6. Scan infrastructure-as-code and ML pipeline Docker images for vulnerable TF versions via OSS dependency scanners (Trivy, Grype).
What systems are affected by CVE-2021-29525?
This vulnerability affects the following AI/ML architecture patterns: CNN training pipelines, multi-tenant ML platforms, MLOps automated retraining pipelines, model serving with gradient computation.
What is the CVSS score for CVE-2021-29525?
CVE-2021-29525 has a CVSS v3.1 base score of 7.8 (HIGH). 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.Conv2DBackpropInput`. This is because the implementation(https://github.com/tensorflow/tensorflow/blob/b40060c9f697b044e3107917c797ba052f4506ab/tensorflow/core/kernels/conv_grad_input_ops.h#L625-L655) 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
On a shared ML training platform (Kubeflow, JupyterHub, SageMaker Studio) running TF < 2.5.0, a malicious tenant submits a training script calling `tf.raw_ops.Conv2DBackpropInput` with parameters crafted to produce a zero-valued divisor in the kernel. The division-by-zero triggers a SIGFPE crash in the TF worker process. In a shared-worker architecture, this disrupts co-tenants' training jobs and corrupts their in-progress checkpoints. Chained with a poisoned training script committed to a shared ML code repository, this becomes a low-effort sabotage vector against a team's model training pipeline — particularly effective against CI/CD-driven automated retraining systems.
Weaknesses (CWE)
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H References
- github.com/tensorflow/tensorflow/commit/2be2cdf3a123e231b16f766aa0e27d56b4606535 Patch 3rd Party
- github.com/tensorflow/tensorflow/security/advisories/GHSA-xm2v-8rrw-w9pm 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