CVE-2022-29205: TensorFlow CPU Segfault Due to Missing Support for Quantized Types
Summary
CVE-2022-29205: Segfault due to missing support for quantized types. Affects tensorflow-cpu across 3 version ranges.
< 2.6.4
>= 2.7.0, < 2.7.2
>= 2.8.0, < 2.8.1
Fixed in 2.6.4, 2.7.2 or 2.8.1, depending on the release line you run. How to fix ↓
Also tracked for
- tensorflow · PyPI
- tensorflow-gpu · PyPI
- tensorflow · Bitnami
- tensorflow · PyPI
The same CVE-2022-29205 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
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.
No signup required · Results in about 60 seconds
Background
TensorFlow is an open-source machine learning library developed by Google. It provides a comprehensive ecosystem for building and deploying machine learning models. TensorFlow supports various data types and operations, enabling developers to create complex neural networks. However, certain operations in TensorFlow, particularly those related to quantized types, may lead to vulnerabilities if not properly handled.
Vulnerability Detail
The vulnerability arises from a potential segmentation fault (segfault) or denial of service when using TensorFlow's compatibility module with operations that do not support quantized types. Specifically, when calling 'tf.compat.v1.*' operations without the necessary kernel for quantized types, a null pointer is passed to the 'ParseDimensionValue' function, leading to dereferencing a null pointer and causing a segfault. This issue can disrupt applications relying on TensorFlow, potentially leading to crashes and service interruptions.
How To Fix
Latest published version: 2.21.0 as of 22 Oct 2026
pip install --upgrade "tensorflow-cpu==2.21.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.6.42.6.4pip install --upgrade "tensorflow-cpu==2.6.4" -
>= 2.7.0, < 2.7.22.7.2pip install --upgrade "tensorflow-cpu==2.7.2" -
>= 2.8.0, < 2.8.12.8.1pip install --upgrade "tensorflow-cpu==2.8.1"
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, avoid using 'tf.compat.v1.*' operations with quantized types until you can update to a patched version. For example, do not use the following code snippet:
import numpy as np import tensorflow as tf
tf.compat.v1.placeholder_with_default(input=np.array([2]), shape=tf.constant(dtype=tf.qint8, value=np.array([1])))
Conclusion
In summary, CVE-2022-29205 is a significant vulnerability in TensorFlow that can lead to application crashes due to improper handling of quantized types. It is crucial to update to the patched versions of TensorFlow to mitigate this risk and ensure the stability of your applications.
See every vulnerability recorded for tensorflow-cpu →
FAQ
CVE-2022-29205 is a vulnerability in TensorFlow that can lead to a segmentation fault when using certain operations without support for quantized types.
You can check if your application is affected by using the Vulert playground at Vulert Scanner, which allows you to monitor and alert for open-source vulnerabilities without requiring signup.
Quantized types in TensorFlow are data types that represent numbers with reduced precision, which can help optimize performance and reduce memory usage in machine learning models.
If you cannot update TensorFlow immediately, avoid using the 'tf.compat.v1.*' operations with quantized types as a temporary workaround.
The CVSS score of this vulnerability is 5.5, indicating a moderate severity level.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow-cpu.