CVE-2021-41222: TensorFlow: SplitV negative arg segfault crashes process
MEDIUM PoC AVAILABLEA malformed negative value in TensorFlow's SplitV operation triggers a segmentation fault, crashing any process running affected versions (< 2.7.0). Patch as part of your next routine TF upgrade cycle — this is not an emergency unless TensorFlow inference is directly exposed to untrusted user inputs. Risk is limited to availability; there is no evidence of data exfiltration or code execution potential.
Risk Assessment
CVSS 5.5 (Medium) reflects the constrained local attack vector — exploitation requires the ability to influence TF operation inputs, which limits exposure significantly. Highest risk surfaces are multi-tenant ML platforms (shared Jupyter environments, CI/CD pipelines accepting user-submitted models) and TF-Serving deployments that process user-controlled tensor shapes. Not in CISA KEV, no active exploitation reported. Treatment: include in routine patching; do not escalate to emergency response unless exposure profile is unusually high.
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 cherrypick patches to 2.6.1, 2.5.2, or 2.4.4.
-
Input validation: Add pre-execution checks enforcing that all values in size_splits are strictly non-negative before invoking SplitV.
-
Process isolation: Run TF inference in isolated containers/processes with automatic restart policies (e.g., Kubernetes restartPolicy: Always) to contain crash blast radius.
-
Detection: Monitor for unexpected SIGSEGV terminations in TF serving processes — repeated crashes on inference endpoints may indicate active probing.
-
Audit: Identify all code paths where size_splits values originate from user-controlled input and add sanitization at those ingestion points.
Classification
Compliance Impact
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2021-41222?
A malformed negative value in TensorFlow's SplitV operation triggers a segmentation fault, crashing any process running affected versions (< 2.7.0). Patch as part of your next routine TF upgrade cycle — this is not an emergency unless TensorFlow inference is directly exposed to untrusted user inputs. Risk is limited to availability; there is no evidence of data exfiltration or code execution potential.
Is CVE-2021-41222 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2021-41222, increasing the risk of exploitation.
How to fix CVE-2021-41222?
1. Patch: Upgrade to TensorFlow 2.7.0, or apply cherrypick patches to 2.6.1, 2.5.2, or 2.4.4. 2. Input validation: Add pre-execution checks enforcing that all values in size_splits are strictly non-negative before invoking SplitV. 3. Process isolation: Run TF inference in isolated containers/processes with automatic restart policies (e.g., Kubernetes restartPolicy: Always) to contain crash blast radius. 4. Detection: Monitor for unexpected SIGSEGV terminations in TF serving processes — repeated crashes on inference endpoints may indicate active probing. 5. Audit: Identify all code paths where size_splits values originate from user-controlled input and add sanitization at those ingestion points.
What systems are affected by CVE-2021-41222?
This vulnerability affects the following AI/ML architecture patterns: model serving, training pipelines, inference.
What is the CVSS score for CVE-2021-41222?
CVE-2021-41222 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 `SplitV` can trigger a segfault is an attacker supplies negative arguments. This occurs whenever `size_splits` contains more than one value and at least one value is negative. 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 TF-Serving inference endpoint crafts a request invoking SplitV with size_splits containing two or more values where at least one is negative (e.g., [-1, 5]). TensorFlow fails to validate the negative entry, triggering a segfault that crashes the server process. In a shared ML notebook environment (Jupyter Hub, SageMaker Studio), a malicious collaborator submits a notebook cell with a crafted SplitV call, crashing the kernel and disrupting co-workers. In a CI/CD pipeline that evaluates community-contributed models, a poisoned model embedding a SplitV call with negative splits could crash the evaluation runner, delaying deployments or silently skipping security gates.
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/25d622ffc432acc736b14ca3904177579e733cc6 Patch 3rd Party
- github.com/tensorflow/tensorflow/security/advisories/GHSA-cpf4-wx82-gxp6 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