CVE-2021-41215: TensorFlow: DeserializeSparse null deref causes DoS
MEDIUM PoC AVAILABLEThis medium-severity vulnerability allows a local low-privilege user to crash TensorFlow processes by supplying malformed sparse tensor data to DeserializeSparse, causing a null pointer dereference. Risk is primarily in shared ML platforms, Jupyter hubs, or multi-tenant training environments where untrusted users can execute TF code. Patch immediately to TF 2.7.0, 2.6.1, 2.5.2, or 2.4.4.
Risk Assessment
MEDIUM-LOW in most deployments. Local access vector (AV:L) significantly limits exposure — an attacker must already have code execution on the target system. However, in shared ML infrastructure (e.g., internal notebook servers, MLOps platforms with shared GPU clusters), a low-privilege user can reliably crash training jobs or inference workers. No active exploitation reported, not in CISA KEV. Impact is limited to availability (DoS), with no confidentiality or integrity implications.
Affected Systems
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| tensorflow | pip | — | No patch |
Do you use tensorflow? You're affected.
Severity & Risk
Attack Surface
Recommended Action
5 steps-
PATCH
Upgrade to TensorFlow 2.7.0, or apply cherrypicked fixes in 2.6.1, 2.5.2, or 2.4.4. Verify via
pip show tensorflow. -
ISOLATE
If patching is not immediately possible, run TF workloads in isolated containers/VMs per tenant to limit blast radius.
-
INPUT VALIDATION
Add pre-processing checks to validate sparse tensor rank and shape (last dimension == 3) before passing to DeserializeSparse.
-
MONITOR
Alert on unexpected TF process crashes (SIGABRT/segfault) in ML infrastructure — repeated crashes may indicate exploitation attempts.
-
INVENTORY
Identify all internal services consuming sparse tensor inputs from external or untrusted sources.
Classification
Compliance Impact
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2021-41215?
This medium-severity vulnerability allows a local low-privilege user to crash TensorFlow processes by supplying malformed sparse tensor data to DeserializeSparse, causing a null pointer dereference. Risk is primarily in shared ML platforms, Jupyter hubs, or multi-tenant training environments where untrusted users can execute TF code. Patch immediately to TF 2.7.0, 2.6.1, 2.5.2, or 2.4.4.
Is CVE-2021-41215 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2021-41215, increasing the risk of exploitation.
How to fix CVE-2021-41215?
1. PATCH: Upgrade to TensorFlow 2.7.0, or apply cherrypicked fixes in 2.6.1, 2.5.2, or 2.4.4. Verify via `pip show tensorflow`. 2. ISOLATE: If patching is not immediately possible, run TF workloads in isolated containers/VMs per tenant to limit blast radius. 3. INPUT VALIDATION: Add pre-processing checks to validate sparse tensor rank and shape (last dimension == 3) before passing to DeserializeSparse. 4. MONITOR: Alert on unexpected TF process crashes (SIGABRT/segfault) in ML infrastructure — repeated crashes may indicate exploitation attempts. 5. INVENTORY: Identify all internal services consuming sparse tensor inputs from external or untrusted sources.
What systems are affected by CVE-2021-41215?
This vulnerability affects the following AI/ML architecture patterns: training pipelines, model serving, shared ML platforms.
What is the CVSS score for CVE-2021-41215?
CVE-2021-41215 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 shape inference code for `DeserializeSparse` can trigger a null pointer dereference. This is because the shape inference function assumes that the `serialize_sparse` tensor is a tensor with positive rank (and having `3` as the last dimension). 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 internal threat actor or compromised service account with access to a shared Jupyter notebook server crafts a TensorFlow graph where DeserializeSparse receives a serialize_sparse tensor with rank 0 or an invalid last dimension. When executed — either directly or injected into a shared training pipeline — the shape inference code dereferences a null pointer, crashing the TF runtime process. In a shared ML platform, this terminates all co-located training jobs, causing denial of service for other users. If TF serves an inference endpoint (e.g., TF Serving on an internal model server), a malformed inference request containing a crafted sparse tensor achieves the same crash, taking down the serving process until restarted.
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/d3738dd70f1c9ceb547258cbb82d853da8771850 Patch 3rd Party
- github.com/tensorflow/tensorflow/security/advisories/GHSA-x3v8-c8qx-3j3r Exploit Patch 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