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.

Risk Assessment

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.

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 1% 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.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.

Classification

Compliance Impact

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.01%.

Technical Details

NVD Description

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)

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