CVE-2022-21727: TensorFlow: Dequantize integer overflow, RCE risk

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

TensorFlow < 2.8.0 has an exploitable integer overflow in the Dequantize op's shape inference, allowing any authenticated network user to corrupt memory and potentially execute arbitrary code on your serving infrastructure. Organizations running quantized TensorFlow models in production—common for latency/cost optimization—are directly exposed. Patch immediately to TF 2.8.0, 2.7.1, 2.6.3, or 2.5.3.

Risk Assessment

High risk for organizations with network-exposed TensorFlow serving infrastructure. CVSS 8.8 with AV:N/AC:L/PR:L means any low-privilege authenticated user can trigger this with a single crafted request—no specialist AI/ML knowledge required. Quantized models are ubiquitous in production deployments for inference efficiency, broadening the attack surface significantly. Not in CISA KEV and published in 2022, so urgency depends on whether affected TF versions are still running.

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
8.8 / 10
EPSS
0.3%
chance of exploitation in 30 days
Higher than 55% 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, 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 High
I High
A High

Recommended Action

5 steps
  1. Upgrade TensorFlow to 2.8.0 or apply cherry-picked fixes to 2.7.1, 2.6.3, or 2.5.3 (commit b64638ec5ccaa77b7c1eb90958e3d85ce381f91b).

  2. Audit all services and containers for bundled TF < 2.8.0 as transitive dependencies.

  3. Restrict network access to TF Serving endpoints to trusted internal principals only—apply network-level controls while patching.

  4. Implement server-side input validation rejecting axis values >= number of tensor dimensions before forwarding to TF ops.

  5. Monitor inference endpoint logs for shape inference errors or anomalous axis parameter values as an indicator of exploitation attempts.

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.6.1.5 - AI system risk treatment
NIST AI RMF
MANAGE 2.2 - Mechanisms for managing AI risks
OWASP LLM Top 10
LLM05 - Supply Chain Vulnerabilities

Frequently Asked Questions

What is CVE-2022-21727?

TensorFlow < 2.8.0 has an exploitable integer overflow in the Dequantize op's shape inference, allowing any authenticated network user to corrupt memory and potentially execute arbitrary code on your serving infrastructure. Organizations running quantized TensorFlow models in production—common for latency/cost optimization—are directly exposed. Patch immediately to TF 2.8.0, 2.7.1, 2.6.3, or 2.5.3.

Is CVE-2022-21727 actively exploited?

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

How to fix CVE-2022-21727?

1. Upgrade TensorFlow to 2.8.0 or apply cherry-picked fixes to 2.7.1, 2.6.3, or 2.5.3 (commit b64638ec5ccaa77b7c1eb90958e3d85ce381f91b). 2. Audit all services and containers for bundled TF < 2.8.0 as transitive dependencies. 3. Restrict network access to TF Serving endpoints to trusted internal principals only—apply network-level controls while patching. 4. Implement server-side input validation rejecting axis values >= number of tensor dimensions before forwarding to TF ops. 5. Monitor inference endpoint logs for shape inference errors or anomalous axis parameter values as an indicator of exploitation attempts.

What systems are affected by CVE-2022-21727?

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

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

CVE-2022-21727 has a CVSS v3.1 base score of 8.8 (HIGH). The EPSS exploitation probability is 0.32%.

Technical Details

NVD Description

Tensorflow is an Open Source Machine Learning Framework. The implementation of shape inference for `Dequantize` is vulnerable to an integer overflow weakness. The `axis` argument can be `-1` (the default value for the optional argument) or any other positive value at most the number of dimensions of the input. Unfortunately, the upper bound is not checked, and, since the code computes `axis + 1`, an attacker can trigger an integer overflow. 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—such as an internal data scientist account or a leaked service credential—crafts a gRPC or REST request invoking a Dequantize operation with an axis value exceeding the tensor's number of dimensions. The shape inference code computes axis + 1 without upper-bound validation, triggering a signed integer overflow (CWE-190). The resulting memory corruption can be leveraged for arbitrary code execution within the TF serving process. From there, the attacker gains access to model weights stored on disk, inference API credentials, and any secrets in the process environment—enabling lateral movement across the ML pipeline.

CVSS Vector

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

Timeline

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

Related Vulnerabilities