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.

Risk Assessment

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.

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 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, 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. 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.

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
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.29%.

Technical Details

NVD Description

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.

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