CVE-2022-21734: TensorFlow: DoS via MapStage non-scalar key crash

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

A low-privilege network attacker can crash any TensorFlow serving instance using the MapStage op by sending a non-scalar key tensor, triggering a process-aborting CHECK failure. Patch to TF 2.8.0, 2.7.1, 2.6.3, or 2.5.3 immediately. If patching is delayed, restrict inference API access to authenticated internal users only.

Risk Assessment

Medium severity but operationally significant for production AI serving. CVSS 6.5 (AV:N/AC:L/PR:L) means any network-reachable TF inference API can be crashed with minimal skill. Only availability is impacted — no data exfiltration risk. Effective risk elevates if TF Serving is internet-exposed, lacks restart resilience, or if AI service uptime is tied to SLA obligations or regulated system operation.

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 backports 2.7.1, 2.6.3, 2.5.3.

  2. Validate inputs: Enforce scalar key constraints at API boundaries before tensors reach MapStage.

  3. Harden access: Require authentication (API keys, mutual TLS) on all TF Serving endpoints — PR:L means any credentialed user can trigger this.

  4. Detect: Alert on abnormal TF serving worker restarts — repeated crashes in a short window signal active exploitation.

  5. Containerize with limits: Set restart limits and exponential backoff in Kubernetes to prevent crash loops from amplifying DoS impact.

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 15 - Accuracy, robustness and cybersecurity
ISO 42001
A.9.2 - AI system testing and validation
NIST AI RMF
MANAGE-2.2 - Mechanisms to sustain value of deployed AI systems
OWASP LLM Top 10
LLM04 - Model Denial of Service

Frequently Asked Questions

What is CVE-2022-21734?

A low-privilege network attacker can crash any TensorFlow serving instance using the MapStage op by sending a non-scalar key tensor, triggering a process-aborting CHECK failure. Patch to TF 2.8.0, 2.7.1, 2.6.3, or 2.5.3 immediately. If patching is delayed, restrict inference API access to authenticated internal users only.

Is CVE-2022-21734 actively exploited?

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

How to fix CVE-2022-21734?

1. Patch: Upgrade to TensorFlow 2.8.0 or backports 2.7.1, 2.6.3, 2.5.3. 2. Validate inputs: Enforce scalar key constraints at API boundaries before tensors reach MapStage. 3. Harden access: Require authentication (API keys, mutual TLS) on all TF Serving endpoints — PR:L means any credentialed user can trigger this. 4. Detect: Alert on abnormal TF serving worker restarts — repeated crashes in a short window signal active exploitation. 5. Containerize with limits: Set restart limits and exponential backoff in Kubernetes to prevent crash loops from amplifying DoS impact.

What systems are affected by CVE-2022-21734?

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

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

CVE-2022-21734 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 `MapStage` is vulnerable a `CHECK`-fail if the key tensor is not a scalar. 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 low-privilege API key to a TF Serving endpoint sends a crafted inference request with a non-scalar tensor (e.g., a 2D matrix) as the MapStage key. The MapStage kernel hits its CHECK assertion, immediately aborting the TensorFlow process. In a Kubernetes deployment without crash loop backoff, the container restarts indefinitely, creating a sustained denial-of-service that kills model availability. No ML expertise is required — only knowledge of the TFX/TF Serving proto schema, which is publicly documented. Automation is trivial: a single script can maintain continuous service disruption.

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