CVE-2021-29572: TensorFlow: null ptr deref crashes SdcaOptimizer op

MEDIUM PoC AVAILABLE
Published May 14, 2021
CISO Take

A local attacker with low privileges can crash any TensorFlow process by invoking SdcaOptimizer with malformed arguments, exploiting a missing input validation that triggers a null pointer dereference. Availability-only impact (no data leakage, no code execution), but in shared ML training clusters this becomes a multi-tenant denial-of-service vector. Patch immediately to TF 2.5.0, 2.4.2, 2.3.3, 2.2.3, or 2.1.4; no workaround exists short of blocking access to raw ops.

What is the risk?

MEDIUM overall, elevated in multi-tenant contexts. CVSS 5.5 reflects local-only reach (AV:L), but in practice ML training infrastructure often runs user-submitted notebooks or jobs with shared TF runtimes — effectively lowering the exploitation barrier to near-zero. No confidentiality or integrity impact; pure availability. EPSS data unavailable but exploitation is trivial: a single malformed op call suffices. Not in CISA KEV, not actively exploited in the wild as of patching date.

What systems are affected?

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

Do you use TensorFlow? You're affected.

How severe is it?

CVSS 3.1
5.5 / 10
EPSS
0.2%
chance of exploitation in 30 days
Higher than 9% 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?

5 steps
  1. PATCH

    Upgrade to TensorFlow 2.5.0 or apply cherry-picks to 2.4.2 / 2.3.3 / 2.2.3 / 2.1.4. Commit f7cc875 is the authoritative fix.

  2. RESTRICT RAW OPS

    Audit whether tf.raw_ops is accessible to untrusted callers; gate it behind authorization in serving endpoints.

  3. SANDBOX

    Run user-submitted TF jobs in isolated processes (containers/VMs) — prevents lateral crash impact in shared clusters.

  4. DETECT

    Alert on TensorFlow process crashes / OOM-kill events in training nodes; unexpected restarts of TFServing pods are the primary signal.

  5. VERIFY

    Confirm installed TF version via python -c "import tensorflow as tf; print(tf.__version__)" across all ML nodes.

How is it classified?

Which compliance frameworks are affected?

This CVE is relevant to:

EU AI Act
Article 15 - Accuracy, robustness and cybersecurity
ISO 42001
A.9.8 - Information security in AI system development
NIST AI RMF
MANAGE 2.2 - Mechanisms to sustain the value of deployed AI
OWASP LLM Top 10
LLM09 - Overreliance

Frequently Asked Questions

What is CVE-2021-29572?

A local attacker with low privileges can crash any TensorFlow process by invoking SdcaOptimizer with malformed arguments, exploiting a missing input validation that triggers a null pointer dereference. Availability-only impact (no data leakage, no code execution), but in shared ML training clusters this becomes a multi-tenant denial-of-service vector. Patch immediately to TF 2.5.0, 2.4.2, 2.3.3, 2.2.3, or 2.1.4; no workaround exists short of blocking access to raw ops.

Is CVE-2021-29572 actively exploited?

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

How to fix CVE-2021-29572?

1. PATCH: Upgrade to TensorFlow 2.5.0 or apply cherry-picks to 2.4.2 / 2.3.3 / 2.2.3 / 2.1.4. Commit f7cc875 is the authoritative fix. 2. RESTRICT RAW OPS: Audit whether tf.raw_ops is accessible to untrusted callers; gate it behind authorization in serving endpoints. 3. SANDBOX: Run user-submitted TF jobs in isolated processes (containers/VMs) — prevents lateral crash impact in shared clusters. 4. DETECT: Alert on TensorFlow process crashes / OOM-kill events in training nodes; unexpected restarts of TFServing pods are the primary signal. 5. VERIFY: Confirm installed TF version via `python -c "import tensorflow as tf; print(tf.__version__)"` across all ML nodes.

What systems are affected by CVE-2021-29572?

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

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

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

What is the AI security impact?

Affected AI Architectures

training pipelinesmodel servingshared ML platforms

MITRE ATLAS Techniques

AML.T0010.001 AI Software
AML.T0029 Denial of AI Service
AML.T0049 Exploit Public-Facing Application

Compliance Controls Affected

EU AI Act: Article 15
ISO 42001: A.9.8
NIST AI RMF: MANAGE 2.2
OWASP LLM Top 10: LLM09

What are the technical details?

Original Advisory

TensorFlow is an end-to-end open source platform for machine learning. The implementation of `tf.raw_ops.SdcaOptimizer` triggers undefined behavior due to dereferencing a null pointer. The implementation(https://github.com/tensorflow/tensorflow/blob/60a45c8b6192a4699f2e2709a2645a751d435cc3/tensorflow/core/kernels/sdca_internal.cc) does not validate that the user supplied arguments satisfy all constraints expected by the op(https://www.tensorflow.org/api_docs/python/tf/raw_ops/SdcaOptimizer). 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 a low-privilege account on a shared ML training platform (e.g., a data scientist in a multi-tenant Jupyter environment or a malicious insider) submits a TF training job that calls tf.raw_ops.SdcaOptimizer with intentionally invalid or null arguments. The missing input validation dereferences a null pointer, crashing the TF runtime process. In a shared cluster, this terminates co-located training jobs from other tenants and potentially corrupts shared checkpointing storage. An attacker could loop this across node restarts to sustain a denial-of-service against the ML platform, delaying production model releases or degrading online serving.

Weaknesses (CWE)

CWE-476 — NULL Pointer Dereference: The product dereferences a pointer that it expects to be valid but is NULL.

  • [Implementation] For any pointers that could have been modified or provided from a function that can return NULL, check the pointer for NULL before use. When working with a multithreaded or otherwise asynchronous environment, ensure that proper locking APIs are used to lock before the check, and unlock when it has finished [REF-1484].
  • [Requirements] Select a programming language that is not susceptible to these issues.

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