CVE-2021-41214: TensorFlow: null deref in ragged ops, local RCE
HIGH PoC AVAILABLEA null pointer dereference in TensorFlow's tf.ragged.cross shape inference enables local attackers with minimal privileges to achieve arbitrary code execution (CVSS 7.8, C:H/I:H/A:H). In shared ML environments—Jupyter hubs, Kubeflow clusters, SageMaker Studio multi-user—any authenticated user can exploit this without interaction. Patch immediately to TensorFlow 2.7.0 or apply the backport commits available for 2.6.1/2.5.2/2.4.4.
Risk Assessment
High risk in multi-tenant ML infrastructure. Low attack complexity and no user interaction required make exploitation reliable once local access is established. Shared training clusters and notebook environments are the highest-exposure surface—data scientists commonly have local script execution in these environments. Single-user workstations are lower risk but should still be patched. Not in CISA KEV and no confirmed active exploitation at time of disclosure, reducing urgency slightly for isolated deployments.
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-
Upgrade TensorFlow to 2.7.0 or apply the cherry-picked patch (commit fa6b7782) to supported versions 2.6.1, 2.5.2, or 2.4.4.
-
Audit all TensorFlow versions across training clusters, notebook servers, model serving infra, and CI/CD pipelines—version drift is common in ML environments.
-
Enforce least-privilege service accounts for ML training jobs; limit blast radius if exploited.
-
In shared environments, isolate user workspaces with namespace-level or container-level boundaries.
-
Monitor for unexpected process spawning or outbound network connections from TensorFlow training jobs as a detection signal.
Classification
Compliance Impact
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2021-41214?
A null pointer dereference in TensorFlow's tf.ragged.cross shape inference enables local attackers with minimal privileges to achieve arbitrary code execution (CVSS 7.8, C:H/I:H/A:H). In shared ML environments—Jupyter hubs, Kubeflow clusters, SageMaker Studio multi-user—any authenticated user can exploit this without interaction. Patch immediately to TensorFlow 2.7.0 or apply the backport commits available for 2.6.1/2.5.2/2.4.4.
Is CVE-2021-41214 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2021-41214, increasing the risk of exploitation.
How to fix CVE-2021-41214?
1. Upgrade TensorFlow to 2.7.0 or apply the cherry-picked patch (commit fa6b7782) to supported versions 2.6.1, 2.5.2, or 2.4.4. 2. Audit all TensorFlow versions across training clusters, notebook servers, model serving infra, and CI/CD pipelines—version drift is common in ML environments. 3. Enforce least-privilege service accounts for ML training jobs; limit blast radius if exploited. 4. In shared environments, isolate user workspaces with namespace-level or container-level boundaries. 5. Monitor for unexpected process spawning or outbound network connections from TensorFlow training jobs as a detection signal.
What systems are affected by CVE-2021-41214?
This vulnerability affects the following AI/ML architecture patterns: training pipelines, feature engineering pipelines, shared notebook environments, model serving.
What is the CVSS score for CVE-2021-41214?
CVE-2021-41214 has a CVSS v3.1 base score of 7.8 (HIGH). 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 `tf.ragged.cross` has an undefined behavior due to binding a reference to `nullptr`. 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 a low-privilege data scientist account on a shared Kubeflow or JupyterHub cluster crafts a Python script calling tf.ragged.cross with malformed ragged tensor inputs designed to pass shape inference and trigger the null pointer dereference in the C++ kernel. The resulting memory corruption in the TensorFlow runtime allows shellcode or ROP chain execution under the training pod's service account, which typically carries broad permissions to object storage (S3/GCS), model registries, and secrets managers. The attacker exfiltrates model artifacts and cloud credentials, then uses those credentials for lateral movement into production inference infrastructure.
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/fa6b7782fbb14aa08d767bc799c531f5e1fb3bb8 Patch 3rd Party
- github.com/tensorflow/tensorflow/security/advisories/GHSA-vwhq-49r4-gj9v 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