CVE-2021-41207: TensorFlow: ParallelConcat div-by-zero crashes ML process
GHSA-7v94-64hj-m82h MEDIUM PoC AVAILABLEA local attacker with low privileges can crash any TensorFlow process by supplying a malformed tensor to the ParallelConcat operation, causing a divide-by-zero. Patch to TensorFlow 2.4.4, 2.5.2, 2.6.1, or 2.7.0+. Risk is limited to availability—no data exfiltration or code execution—but unpatched model-serving infrastructure running shared workloads is the priority target.
Risk Assessment
Low operational risk in most environments. CVSS 5.5 Medium with local-only attack vector and EPSS 0.00017 signal negligible real-world exploitation interest. However, in multi-tenant ML platforms or model-serving clusters where users can submit arbitrary computation graphs, the blast radius expands: a single crafted request can crash the serving process and cause service outage. Not in CISA KEV and no known public exploits.
Affected Systems
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| tensorflow | pip | — | No patch |
| tensorflow | pip | >= 2.6.0, < 2.6.1 | 2.6.1 |
| tensorflow-cpu | pip | >= 0, < 2.4.4 | 2.4.4 |
| tensorflow-gpu | pip | >= 0, < 2.4.4 | 2.4.4 |
Severity & Risk
Attack Surface
Recommended Action
4 steps-
Patch: upgrade tensorflow, tensorflow-cpu, or tensorflow-gpu to >= 2.4.4 (for 2.4.x), >= 2.5.2 (for 2.5.x), >= 2.6.1 (for 2.6.x), or >= 2.7.0.
-
Workaround: add input shape validation before any ParallelConcat call; reject zero-dimension tensors.
-
Serving hardening: run TF serving workers as separate processes with crash recovery; isolate per-tenant inference processes so one crash does not affect other users.
-
Detection: alert on unexpected TF process terminations (SIGFPE / SIGABRT) in your ML infrastructure monitoring.
Classification
Compliance Impact
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2021-41207?
A local attacker with low privileges can crash any TensorFlow process by supplying a malformed tensor to the ParallelConcat operation, causing a divide-by-zero. Patch to TensorFlow 2.4.4, 2.5.2, 2.6.1, or 2.7.0+. Risk is limited to availability—no data exfiltration or code execution—but unpatched model-serving infrastructure running shared workloads is the priority target.
Is CVE-2021-41207 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2021-41207, increasing the risk of exploitation.
How to fix CVE-2021-41207?
1. Patch: upgrade tensorflow, tensorflow-cpu, or tensorflow-gpu to >= 2.4.4 (for 2.4.x), >= 2.5.2 (for 2.5.x), >= 2.6.1 (for 2.6.x), or >= 2.7.0. 2. Workaround: add input shape validation before any ParallelConcat call; reject zero-dimension tensors. 3. Serving hardening: run TF serving workers as separate processes with crash recovery; isolate per-tenant inference processes so one crash does not affect other users. 4. Detection: alert on unexpected TF process terminations (SIGFPE / SIGABRT) in your ML infrastructure monitoring.
What systems are affected by CVE-2021-41207?
This vulnerability affects the following AI/ML architecture patterns: training pipelines, model serving, batch inference.
What is the CVSS score for CVE-2021-41207?
CVE-2021-41207 has a CVSS v3.1 base score of 5.5 (MEDIUM). The EPSS exploitation probability is 0.02%.
Technical Details
NVD Description
TensorFlow is an open source platform for machine learning. In affected versions the implementation of `ParallelConcat` misses some input validation and can produce a division by 0. The fix will be included in TensorFlow 2.7.0. We will also cherrypick this commit on TensorFlow 2.6.1, TensorFlow 2.5.2, and TensorFlow 2.4.4, as these are also affected and still in supported range.
Exploitation Scenario
An attacker with access to a shared ML platform—e.g., a data scientist on a multi-tenant Jupyter environment or a user submitting jobs to a batch training cluster—constructs a TensorFlow graph containing a ParallelConcat node whose input dimensions trigger a division-by-zero in the kernel. Submitting this graph causes the TF runtime to crash, taking down the shared serving process or training job scheduler. In a model-serving API, a crafted inference request containing the malformed tensor achieves the same result, causing an outage without any authentication beyond basic API access.
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/advisories/GHSA-7v94-64hj-m82h
- github.com/pypa/advisory-database/tree/main/vulns/tensorflow-cpu/PYSEC-2021-616.yaml
- github.com/pypa/advisory-database/tree/main/vulns/tensorflow-gpu/PYSEC-2021-814.yaml
- github.com/pypa/advisory-database/tree/main/vulns/tensorflow/PYSEC-2021-399.yaml
- github.com/tensorflow/tensorflow/blob/8d72537c6abf5a44103b57b9c2e22c14f5f49698/tensorflow/core/kernels/inplace_ops.cc
- github.com/tensorflow/tensorflow/commit/9de11bdc2cf1284b2f635419bd3e6bbc7643eb2c
- github.com/tensorflow/tensorflow/commit/d11f21bbdfa54f3576ae860fc927bf23c675ebc0
- github.com/tensorflow/tensorflow/commit/e67caccea81167402c62977b5c521f2a8b261d6a
- nvd.nist.gov/vuln/detail/CVE-2021-41207
- github.com/tensorflow/tensorflow/commit/f2c3931113eaafe9ef558faaddd48e00a6606235 Patch 3rd Party
- github.com/tensorflow/tensorflow/security/advisories/GHSA-7v94-64hj-m82h 3rd Party
- github.com/ARPSyndicate/cvemon Exploit
- github.com/adwisatya/SnykVulndb Exploit
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