CVE-2022-21734: TensorFlow: DoS via MapStage non-scalar key crash
MEDIUMPoC AVAILABLECISA: TRACK*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.
What is the risk?
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.
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| TensorFlow | pip | — | No patch |
Do you use TensorFlow? You're affected.
How severe is it?
What is the attack surface?
What should I do?
5 stepsPatch: Upgrade to TensorFlow 2.8.0 or backports 2.7.1, 2.6.3, 2.5.3.
Validate inputs: Enforce scalar key constraints at API boundaries before tensors reach MapStage.
Harden access: Require authentication (API keys, mutual TLS) on all TF Serving endpoints — PR:L means any credentialed user can trigger this.
Detect: Alert on abnormal TF serving worker restarts — repeated crashes in a short window signal active exploitation.
Containerize with limits: Set restart limits and exponential backoff in Kubernetes to prevent crash loops from amplifying DoS impact.
What does CISA's SSVC say?
Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.
How is it classified?
Which compliance frameworks are affected?
This CVE is relevant to:
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.79%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0010.001AI SoftwareAML.T0029Denial of AI ServiceAML.T0049Exploit Public-Facing ApplicationCompliance Controls Affected
What are the technical details?
Original Advisory
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.
Weaknesses (CWE)
CWE-843Access of Resource Using Incompatible TypePrimaryCWE-843Access of Resource Using Incompatible TypeCWE-843 — Access of Resource Using Incompatible Type: The product allocates or initializes a resource such as a pointer, object, or variable using one type, but it later accesses that resource using a type that is incompatible with the original type.
Source: MITRE CWE corpus.
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:HReferences
- github.com/tensorflow/tensorflow/blob/5100e359aef5c8021f2e71c7b986420b85ce7b3d/tensorflow/core/kernels/map_stage_op.ccExploit3rd Party
- github.com/tensorflow/tensorflow/commit/f57315566d7094f322b784947093406c2aea0d7dPatch3rd Party
- github.com/tensorflow/tensorflow/security/advisories/GHSA-gcvh-66ff-4mwmPatch3rd Party
Timeline
Related Vulnerabilities
CVE-2026-189489.9Feast: insecure UDF deserialization enables RCE
Same package: tensorflowCVE-2020-151969.9TensorFlow: heap OOB read in sparse/ragged count ops
Same package: tensorflowCVE-2020-152059.8TensorFlow: heap overflow in StringNGrams, ASLR bypass
Same package: tensorflowCVE-2019-167789.8TensorFlow: heap overflow in UnsortedSegmentSum op
Same package: tensorflowCVE-2020-152089.8TFLite: OOB read/write via tensor dimension mismatch
Same package: tensorflow