CVE-2021-29617: TensorFlow: DoS via CHECK-fail in strings.substr

GHSA-mmq6-q8r3-48fm MEDIUM PoC AVAILABLE
Published May 14, 2021
CISO Take

A local attacker with low-privilege access can crash TensorFlow processes by passing invalid arguments to tf.strings.substr, triggering a CHECK-fail denial of service. The local-only attack vector significantly limits blast radius — remote exploitation requires a separate vulnerability to achieve local access first. Patch to TensorFlow 2.1.4+, 2.2.3+, 2.3.3+, 2.4.2+, or 2.5.0+ to remediate.

What is the risk?

Low-to-medium operational risk. CVSS 5.5 with a local attack vector and low privileges keeps real-world exploitation unlikely (EPSS: 0.0005, not in CISA KEV). Impact is availability-only — no data exfiltration or integrity compromise. Risk elevates in multi-tenant ML environments (shared GPU clusters, hosted Jupyter notebooks) where local access is more easily achievable by untrusted users.

What systems are affected?

Package Ecosystem Vulnerable Range Patched
TensorFlow pip No patch
195.8K OpenSSF 7.1 3.7K dependents Pushed 5d ago 4% patched ~1372d to patch Full package profile →
TensorFlow pip < 2.1.4 2.1.4
195.8K OpenSSF 7.1 3.7K dependents Pushed 5d ago 4% patched ~1372d to patch Full package profile →
TensorFlow pip < 2.1.4 2.1.4
195.8K OpenSSF 7.1 3.7K dependents Pushed 5d ago 4% patched ~1372d to patch Full package profile →
TensorFlow pip < 2.1.4 2.1.4
195.8K OpenSSF 7.1 3.7K dependents Pushed 5d ago 4% patched ~1372d to patch Full package profile →

How severe is it?

CVSS 3.1
5.5 / 10
EPSS
0.2%
chance of exploitation in 30 days
Higher than 14% 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, VulnCheck KEV, CISA SSVC, EPSS, Metasploit, Exploit-DB, trickest/cve, Nuclei templates, and inthewild.io exploitation reports.

What is the 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

What should I do?

4 steps
  1. Upgrade to TensorFlow ≥2.1.4, ≥2.2.3, ≥2.3.3, ≥2.4.2, or ≥2.5.0 depending on the branch in use.

  2. If immediate patching is blocked, validate and sanitize arguments passed to tf.strings.substr before invocation — specifically enforce valid position and length bounds.

  3. Restrict local system access to TensorFlow processes via OS-level controls and least-privilege principles.

  4. Monitor for abnormal TensorFlow process crashes as a potential indicator of exploitation attempts in shared environments.

How is it classified?

Which compliance frameworks are affected?

This CVE is relevant to:

EU AI Act
Art. 15 - Accuracy, Robustness and Cybersecurity
ISO 42001
6.1.2 - AI Risk Assessment — Availability
NIST AI RMF
MANAGE-2.2 - Treatment of Identified AI Risks

Frequently Asked Questions

What is CVE-2021-29617?

A local attacker with low-privilege access can crash TensorFlow processes by passing invalid arguments to tf.strings.substr, triggering a CHECK-fail denial of service. The local-only attack vector significantly limits blast radius — remote exploitation requires a separate vulnerability to achieve local access first. Patch to TensorFlow 2.1.4+, 2.2.3+, 2.3.3+, 2.4.2+, or 2.5.0+ to remediate.

Is CVE-2021-29617 actively exploited?

Proof-of-concept exploit code is publicly available for CVE-2021-29617, increasing the risk of exploitation.

How to fix CVE-2021-29617?

1. Upgrade to TensorFlow ≥2.1.4, ≥2.2.3, ≥2.3.3, ≥2.4.2, or ≥2.5.0 depending on the branch in use. 2. If immediate patching is blocked, validate and sanitize arguments passed to tf.strings.substr before invocation — specifically enforce valid position and length bounds. 3. Restrict local system access to TensorFlow processes via OS-level controls and least-privilege principles. 4. Monitor for abnormal TensorFlow process crashes as a potential indicator of exploitation attempts in shared environments.

What systems are affected by CVE-2021-29617?

This vulnerability affects the following AI/ML architecture patterns: training pipelines, model serving, data preprocessing.

What is the CVSS score for CVE-2021-29617?

CVE-2021-29617 has a CVSS v3.1 base score of 5.5 (MEDIUM). The EPSS exploitation probability is 0.23%.

What is the AI security impact?

Affected AI Architectures

training pipelinesmodel servingdata preprocessing

MITRE ATLAS Techniques

AML.T0010.001 AI Software
AML.T0029 Denial of AI Service

Compliance Controls Affected

EU AI Act: Art. 15
ISO 42001: 6.1.2
NIST AI RMF: MANAGE-2.2

What are the technical details?

Original Advisory

TensorFlow is an end-to-end open source platform for machine learning. An attacker can cause a denial of service via `CHECK`-fail in `tf.strings.substr` with invalid arguments. The fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2, TensorFlow 2.3.3, TensorFlow 2.2.3 and TensorFlow 2.1.4, as these are also affected and still in supported range.

Exploitation Scenario

An adversary with low-privilege local access to a shared ML training server crafts a Python script calling tf.strings.substr with invalid arguments (e.g., out-of-bounds position or negative length). The internal CHECK assertion fails, immediately crashing the TensorFlow process. In a shared Jupyter notebook environment or multi-tenant ML platform, this disrupts concurrent training jobs and inference services belonging to other users — potentially causing costly training restarts or SLA violations without any permanent damage to data or models.

Weaknesses (CWE)

CWE-755 — Improper Handling of Exceptional Conditions: The product does not handle or incorrectly handles an exceptional condition.

Source: MITRE CWE corpus.

CVSS Vector

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

Timeline

Published
May 14, 2021
Last Modified
November 21, 2024
First Seen
May 14, 2021

Related Vulnerabilities