CVE-2022-21729: TensorFlow: UnravelIndex integer overflow → DoS

MEDIUM PoC AVAILABLE CISA: TRACK*
Published February 3, 2022
CISO Take

A remotely triggerable integer overflow in TensorFlow's UnravelIndex op allows any authenticated user to crash TF serving workers via crafted tensor inputs, resulting in full availability loss. No data exfiltration risk, but production model serving endpoints are vulnerable if running unpatched TF 2.5–2.7. Patch immediately to TF 2.8.0, 2.7.1, 2.6.3, or 2.5.3 — all available as of early 2022.

Risk Assessment

Medium risk overall, but elevated for organizations exposing TensorFlow Serving APIs to external or semi-trusted clients. CVSS 6.5 reflects low-complexity, network-accessible DoS with no privilege escalation. The absence of a confidentiality or integrity impact limits blast radius to availability. Not in CISA KEV, no known active exploitation in the wild. Risk increases in multi-tenant ML platforms where tenants can supply arbitrary model inputs.

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
6.5 / 10
EPSS
0.2%
chance of exploitation in 30 days
Higher than 44% of all CVEs
Exploitation Status
Exploit Available
Exploitation: MEDIUM
Sophistication
Trivial
Exploitation Confidence
medium
CISA SSVC: Public PoC
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 Network
AC Low
PR Low
UI None
S Unchanged
C None
I None
A High

Recommended Action

5 steps
  1. PATCH

    Upgrade to TensorFlow 2.8.0 (or cherry-picked fixes in 2.7.1, 2.6.3, 2.5.3). Commit 58b34c6 contains the fix.

  2. WORKAROUND

    Add input validation middleware to TF Serving that rejects tensors with out-of-range index values before they reach the op layer.

  3. ISOLATION

    Run TF Serving workers in containers/pods with automatic restart policies (k8s restartPolicy: Always) to minimize downtime from crashes.

  4. DETECTION

    Monitor for sudden TF worker process crashes or serving pod restarts correlated with specific client IPs or request patterns — repeated crashes from same source indicate active probing.

  5. NETWORK

    Restrict UnravelIndex-using endpoints to trusted networks if business logic permits.

CISA SSVC Assessment

Decision Track*
Exploitation poc
Automatable No
Technical Impact partial

Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.

Classification

Compliance Impact

This CVE is relevant to:

EU AI Act
Article 9 - Risk management system
ISO 42001
A.9.3 - AI system operation and monitoring
NIST AI RMF
MANAGE-2.2 - Mechanisms for AI system resilience and continuity
OWASP LLM Top 10
LLM09:2025 - Misinformation and Overreliance

Frequently Asked Questions

What is CVE-2022-21729?

A remotely triggerable integer overflow in TensorFlow's UnravelIndex op allows any authenticated user to crash TF serving workers via crafted tensor inputs, resulting in full availability loss. No data exfiltration risk, but production model serving endpoints are vulnerable if running unpatched TF 2.5–2.7. Patch immediately to TF 2.8.0, 2.7.1, 2.6.3, or 2.5.3 — all available as of early 2022.

Is CVE-2022-21729 actively exploited?

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

How to fix CVE-2022-21729?

1. PATCH: Upgrade to TensorFlow 2.8.0 (or cherry-picked fixes in 2.7.1, 2.6.3, 2.5.3). Commit 58b34c6 contains the fix. 2. WORKAROUND: Add input validation middleware to TF Serving that rejects tensors with out-of-range index values before they reach the op layer. 3. ISOLATION: Run TF Serving workers in containers/pods with automatic restart policies (k8s restartPolicy: Always) to minimize downtime from crashes. 4. DETECTION: Monitor for sudden TF worker process crashes or serving pod restarts correlated with specific client IPs or request patterns — repeated crashes from same source indicate active probing. 5. NETWORK: Restrict UnravelIndex-using endpoints to trusted networks if business logic permits.

What systems are affected by CVE-2022-21729?

This vulnerability affects the following AI/ML architecture patterns: model serving, training pipelines, inference APIs, shared ML notebook environments.

What is the CVSS score for CVE-2022-21729?

CVE-2022-21729 has a CVSS v3.1 base score of 6.5 (MEDIUM). The EPSS exploitation probability is 0.22%.

Technical Details

NVD Description

Tensorflow is an Open Source Machine Learning Framework. The implementation of `UnravelIndex` is vulnerable to a division by zero caused by an integer overflow bug. The fix will be included in TensorFlow 2.8.0. We will also cherrypick this commit on TensorFlow 2.7.1, TensorFlow 2.6.3, and TensorFlow 2.5.3, as these are also affected and still in supported range.

Exploitation Scenario

An attacker with a valid API key (low privilege) to a production TF Serving endpoint discovers that the served model uses the UnravelIndex operation (visible via model metadata or reverse engineering). They craft inference requests containing tensors with extremely large integer values designed to trigger the overflow in the divisor computation — no AI/ML expertise required, only knowledge of the op's input shape. Each malicious request crashes the TF worker process. Automated retries from legitimate clients keep the endpoint flapping. In a Kubernetes deployment without proper PodDisruptionBudgets, this achieves sustained denial of service against the ML inference layer.

CVSS Vector

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

Timeline

Published
February 3, 2022
Last Modified
May 5, 2025
First Seen
February 3, 2022

Related Vulnerabilities