CVE-2022-21726: TensorFlow: heap OOB read in Dequantize op allows RCE

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

Any TensorFlow deployment accepting external inference requests with quantized models is exposed to this heap out-of-bounds read. With CVSS 8.8, network-exploitable with low privilege requirements, an authenticated API caller can crash your inference servers or potentially achieve code execution. Patch to TF 2.8.0, 2.7.1, 2.6.3, or 2.5.3 immediately and restrict API access to inference endpoints.

What is the risk?

High severity (CVSS 8.8). Network-accessible TensorFlow Serving instances are the primary attack surface. Low attack complexity and minimal privilege requirements—any authenticated API user—make exploitation accessible to moderately skilled attackers. The OOB read in a heap-allocated dimensions array with C:H/I:H/A:H impact scoring indicates potential for memory disclosure escalating to RCE. Production AI inference deployments using quantized models—common in optimized serving and edge AI scenarios—are directly and broadly exposed.

What systems are affected?

Package Ecosystem Vulnerable Range Patched
TensorFlow pip No patch
195.8K OpenSSF 7.1 3.7K dependents Pushed 3d ago 4% patched ~1372d to patch Full package profile →

Do you use TensorFlow? You're affected.

How severe is it?

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

What should I do?

5 steps
  1. PATCH

    Upgrade TensorFlow to 2.8.0, or apply backport patches to 2.7.1, 2.6.3, or 2.5.3—commit 23968a8b is the authoritative fix.

  2. DETECT

    Monitor TF Serving access logs for requests triggering Dequantize with anomalously large axis values; elevated error rates on quantization ops are an early signal.

  3. RESTRICT

    Apply input validation at the API gateway layer enforcing axis parameter bounds before reaching TF kernels.

  4. ISOLATE

    Run TF Serving in isolated containers with memory limits to contain heap exploit blast radius.

  5. AUDIT

    TF is often embedded transitively in higher-level frameworks (Keras, TFX, ML pipelines); verify the full dependency tree is patched.

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
8.4 - AI system operation and monitoring
NIST AI RMF
MANAGE-2.2 - Mechanisms to sustain the value of deployed AI systems
OWASP LLM Top 10
LLM05:2025 - Supply Chain Vulnerabilities

Frequently Asked Questions

What is CVE-2022-21726?

Any TensorFlow deployment accepting external inference requests with quantized models is exposed to this heap out-of-bounds read. With CVSS 8.8, network-exploitable with low privilege requirements, an authenticated API caller can crash your inference servers or potentially achieve code execution. Patch to TF 2.8.0, 2.7.1, 2.6.3, or 2.5.3 immediately and restrict API access to inference endpoints.

Is CVE-2022-21726 actively exploited?

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

How to fix CVE-2022-21726?

1. PATCH: Upgrade TensorFlow to 2.8.0, or apply backport patches to 2.7.1, 2.6.3, or 2.5.3—commit 23968a8b is the authoritative fix. 2. DETECT: Monitor TF Serving access logs for requests triggering Dequantize with anomalously large axis values; elevated error rates on quantization ops are an early signal. 3. RESTRICT: Apply input validation at the API gateway layer enforcing axis parameter bounds before reaching TF kernels. 4. ISOLATE: Run TF Serving in isolated containers with memory limits to contain heap exploit blast radius. 5. AUDIT: TF is often embedded transitively in higher-level frameworks (Keras, TFX, ML pipelines); verify the full dependency tree is patched.

What systems are affected by CVE-2022-21726?

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

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

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

What is the AI security impact?

Affected AI Architectures

model servinginference pipelinestraining pipelinesedge AI deployment

MITRE ATLAS Techniques

AML.T0010.001 AI Software
AML.T0049 Exploit Public-Facing Application

Compliance Controls Affected

EU AI Act: Article 15
ISO 42001: 8.4
NIST AI RMF: MANAGE-2.2
OWASP LLM Top 10: LLM05:2025

What are the technical details?

Original Advisory

Tensorflow is an Open Source Machine Learning Framework. The implementation of `Dequantize` does not fully validate the value of `axis` and can result in heap OOB accesses. 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 this results in reading past the end of the array containing the dimensions of the input tensor. 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 REST endpoint submits a crafted inference request containing a quantized tensor with the axis parameter set to a value exceeding the tensor's actual dimensionality. The Dequantize kernel reads past the end of the heap-allocated dimensions array without upper-bound validation, triggering memory disclosure or a crash. In a targeted attack, the adversary iterates over axis values to probe adjacent heap memory, potentially exposing model weights, credentials stored in memory, or constructing a write primitive for full code execution. The low attack complexity means this requires only a valid API key or access to an unauthenticated TF Serving endpoint.

Weaknesses (CWE)

CWE-125 — Out-of-bounds Read: The product reads data past the end, or before the beginning, of the intended buffer.

  • [Implementation] Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does. When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue." Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylis
  • [Architecture and Design] Use a language that provides appropriate memory abstractions.

Source: MITRE CWE corpus.

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