CVE-2022-21731: TensorFlow: ConcatV2 type confusion enables remote DoS

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

Any TensorFlow deployment exposing model inference via an API is vulnerable to a crash triggered by a malformed ConcatV2 axis argument — no authentication bypass needed, just low-privilege access. Patch immediately to TF 2.8.0 (or cherrypick backports for 2.5–2.7). If you cannot patch now, add input validation middleware to reject negative axis values on ConcatV2 operations at the serving layer.

What is the risk?

Medium severity by CVSS (6.5), but operationally significant for production ML environments. The attack requires only low privileges and no user interaction, meaning any authenticated API user can crash a TensorFlow serving process. In multi-tenant inference platforms or shared training clusters, this becomes a lateral disruption risk — one malicious or compromised tenant can take down shared infrastructure. Not currently in CISA KEV and no evidence of active exploitation, but the exploit path is straightforward given public PoC references in the advisory.

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
6.5 / 10
EPSS
0.8%
chance of exploitation in 30 days
Higher than 53% of all CVEs
Exploitation Status
Exploit Available
Exploitation: MEDIUM
Sophistication
Moderate
Exploitation Confidence
medium
CISA SSVC: Public PoC
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 Network
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.8.0, or apply backport commits to 2.7.1, 2.6.3, or 2.5.3. Commit 08d7b00 contains the fix.

  2. WORKAROUND

    Validate that axis arguments for ConcatV2 operations are non-negative integers before execution; reject requests with negative axis values at the API gateway or input validation layer.

  3. ISOLATION

    Run TF Serving in containers with automatic restart policies (e.g., Kubernetes Deployment with restartPolicy: Always) to minimize MTTR if exploited.

  4. DETECTION

    Monitor for sudden TF process terminations (segfaults in logs) or spikes in inference API 5xx errors — these may indicate exploitation attempts.

  5. NETWORK CONTROLS

    Restrict TF Serving API access to trusted clients only; avoid exposing raw graph execution APIs to untrusted users.

What does CISA's SSVC say?

Decision Track*
Exploitation poc
Automatable No
Technical Impact partial

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:

EU AI Act
Article 15 - Accuracy, robustness and cybersecurity
ISO 42001
A.6.2.4 - Robustness of AI systems A.6.2.5 - Security of AI systems
NIST AI RMF
MANAGE-2.2 - Mechanisms to sustain AI system value and manage risks MAP-5.1 - Likelihood of harmful impacts from AI systems is estimated

Frequently Asked Questions

What is CVE-2022-21731?

Any TensorFlow deployment exposing model inference via an API is vulnerable to a crash triggered by a malformed ConcatV2 axis argument — no authentication bypass needed, just low-privilege access. Patch immediately to TF 2.8.0 (or cherrypick backports for 2.5–2.7). If you cannot patch now, add input validation middleware to reject negative axis values on ConcatV2 operations at the serving layer.

Is CVE-2022-21731 actively exploited?

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

How to fix CVE-2022-21731?

1. PATCH: Upgrade to TensorFlow 2.8.0, or apply backport commits to 2.7.1, 2.6.3, or 2.5.3. Commit 08d7b00 contains the fix. 2. WORKAROUND: Validate that axis arguments for ConcatV2 operations are non-negative integers before execution; reject requests with negative axis values at the API gateway or input validation layer. 3. ISOLATION: Run TF Serving in containers with automatic restart policies (e.g., Kubernetes Deployment with restartPolicy: Always) to minimize MTTR if exploited. 4. DETECTION: Monitor for sudden TF process terminations (segfaults in logs) or spikes in inference API 5xx errors — these may indicate exploitation attempts. 5. NETWORK CONTROLS: Restrict TF Serving API access to trusted clients only; avoid exposing raw graph execution APIs to untrusted users.

What systems are affected by CVE-2022-21731?

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

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

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

What is the AI security impact?

Affected AI Architectures

model servingtraining pipelinesML platform APIs

MITRE ATLAS Techniques

AML.T0029 Denial of AI Service
AML.T0040 AI Model Inference API Access
AML.T0049 Exploit Public-Facing Application

Compliance Controls Affected

EU AI Act: Article 15
ISO 42001: A.6.2.4, A.6.2.5
NIST AI RMF: MANAGE-2.2, MAP-5.1

What are the technical details?

Original Advisory

Tensorflow is an Open Source Machine Learning Framework. The implementation of shape inference for `ConcatV2` can be used to trigger a denial of service attack via a segfault caused by a type confusion. The `axis` argument is translated into `concat_dim` in the `ConcatShapeHelper` helper function. Then, a value for `min_rank` is computed based on `concat_dim`. This is then used to validate that the `values` tensor has at least the required rank. However, `WithRankAtLeast` receives the lower bound as a 64-bits value and then compares it against the maximum 32-bits integer value that could be represented. Due to the fact that `min_rank` is a 32-bits value and the value of `axis`, the `rank` argument is a negative value, so the error check is bypassed. 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 adversary with low-privilege API access to a TensorFlow Serving endpoint submits an inference request that includes a ConcatV2 operation with a crafted negative axis value (e.g., axis=-2147483648). The shape inference path translates this into a negative min_rank value, which when cast to 64-bit for comparison bypasses the rank validation check in WithRankAtLeast. TensorFlow proceeds with invalid state, causing a segfault that crashes the serving process. In a shared ML platform scenario, an attacker could repeatedly trigger this to maintain availability disruption against other tenants, or use it to force a service restart during a coordinated attack window.

Weaknesses (CWE)

CWE-843 — Access of Resource Using Incompatible Type ('Type Confusion'): 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:H

Timeline

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

Related Vulnerabilities