CVE-2021-41222: TensorFlow: SplitV negative arg segfault crashes process

MEDIUM PoC AVAILABLE
Published November 5, 2021
CISO Take

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.

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
195.0K OpenSSF 7.2 3.7K dependents Pushed 6d ago 4% patched ~1372d to patch Full package profile →

Do you use tensorflow? You're affected.

Severity & Risk

CVSS 3.1
5.5 / 10
EPSS
0.0%
chance of exploitation in 30 days
Higher than 4% of all CVEs
Exploitation Status
Exploit Available
Exploitation: MEDIUM
Sophistication
Trivial
Exploitation Confidence
medium
Public PoC indexed (trickest/cve)
Composite signal derived from CISA KEV, CISA SSVC, EPSS, trickest/cve, and Nuclei templates.

Attack Surface

AV AC PR UI S C I A
AV Local
AC Low
PR Low
UI None
S Unchanged
C None
I None
A High

Recommended Action

5 steps
  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.

Classification

Compliance Impact

This CVE is relevant to:

EU AI Act
Art. 15 - Accuracy, Robustness and Cybersecurity
ISO 42001
A.6.1.6 - AI system operation and monitoring
NIST AI RMF
MEASURE 2.5 - AI System Robustness and Reliability
OWASP LLM Top 10
LLM04 - Model Denial of Service

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

Timeline

Published
November 5, 2021
Last Modified
November 21, 2024
First Seen
November 5, 2021

Related Vulnerabilities