CVE-2022-21726: TensorFlow GPU - Heap Out-of-Bounds Access in Dequantize

tensorflow-gpu Updated 02 Oct 2025

Summary

03/02/2022
Yes i
Unrated
Not published

CVE-2022-21726: Tensorflow is an Open Source Machine Learning Framework. Affects tensorflow-gpu across 3 version ranges.

< 2.5.3 >= 2.6.0, < 2.6.3 < 23968a8bf65b009120c43b5ebcceaf52dbc9e943

Fixed in 2.5.3 or 2.6.3, depending on the release line you run. How to fix ↓

Also tracked for

The same CVE-2022-21726 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

TensorFlow is an open-source machine learning framework widely used for developing and deploying machine learning models. It provides a comprehensive set of tools and libraries for building and training neural networks. TensorFlow GPU is a variant of TensorFlow that leverages the power of GPUs for accelerated computation.

Vulnerability Detail

The vulnerability (CVE-2022-21726) affects the Dequantize function in TensorFlow GPU. This function is responsible for converting quantized tensors back to floating-point tensors. The issue arises from inadequate validation of the axis argument, which specifies the axis along which the dequantization should be performed. The axis argument can be set to -1 or any positive value up to the number of dimensions of the input tensor. However, the upper bound is not properly checked, leading to heap out-of-bounds accesses. An attacker could exploit this vulnerability to read past the end of the array containing the dimensions of the input tensor, potentially resulting in information disclosure or arbitrary code execution.

How To Fix

Latest published version: 2.12.0 as of 22 Oct 2026

pip install --upgrade "tensorflow-gpu==2.12.0"

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 2.5.3 2.5.3
    pip install --upgrade "tensorflow-gpu==2.5.3"
  • >= 2.6.0, < 2.6.3 2.6.3
    pip install --upgrade "tensorflow-gpu==2.6.3"

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

As a temporary workaround, users can avoid using the Dequantize function with a custom axis value. Stick to the default value of -1 or use one of the valid positive values up to the number of dimensions of the input tensor. By doing so, the vulnerability can be bypassed.

Conclusion

The vulnerability (CVE-2022-21726) in TensorFlow GPU's Dequantize function can result in heap out-of-bounds accesses. It is crucial to update to the latest patched version of TensorFlow GPU or apply the provided workaround to mitigate the risk. For further assistance or support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for tensorflow-gpu →

Share this vulnerability

FAQ

TensorFlow is an open-source machine learning framework used for building and training neural networks. It provides a wide range of tools and libraries for developing machine learning models.

TensorFlow GPU is a variant of TensorFlow that utilizes the power of GPUs for accelerated computation. It is specifically designed to leverage the parallel processing capabilities of GPUs to enhance performance.

Dequantize is a function in TensorFlow GPU that converts quantized tensors, which represent numbers with reduced precision, back to floating-point tensors with full precision. It is commonly used in machine learning models that involve quantization techniques.

The vulnerability can be exploited by providing a malicious axis value to the Dequantize function. By setting an invalid axis value that exceeds the number of dimensions of the input tensor, an attacker can trigger heap out-of-bounds accesses, potentially leading to information disclosure or arbitrary code execution.

Yes, the vulnerability will be fixed in TensorFlow 2.8.0. The fix will also be backported to TensorFlow 2.7.1, TensorFlow 2.6.3, and TensorFlow 2.5.3. It is recommended to update to the latest patched version of TensorFlow GPU to mitigate the vulnerability.

Related vulnerabilities

Recent vulnerabilities recorded for tensorflow-gpu.

How To Fix

Latest published version: 2.12.0 as of 22 Oct 2026

pip install --upgrade "tensorflow-gpu==2.12.0"

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 2.5.3 2.5.3
    pip install --upgrade "tensorflow-gpu==2.5.3"
  • >= 2.6.0, < 2.6.3 2.6.3
    pip install --upgrade "tensorflow-gpu==2.6.3"

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback