CVE-2022-41908: TensorFlow CHECK Fail via Non-UTF-8 Token Input
Summary
CVE-2022-41908: CHECK fail via inputs in PyFunc. Affects tensorflow across 3 version ranges.
< 2.8.4
>= 2.9.0, < 2.9.3
>= 2.10.0, < 2.10.1
Fixed in 2.8.4, 2.9.3 or 2.10.1, depending on the release line you run. How to fix ↓
Also tracked for
- tensorflow-cpu · PyPI
- tensorflow-gpu · PyPI
- tensorflow · Bitnami
The same CVE-2022-41908 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 framework that provides a comprehensive ecosystem for building and deploying machine learning models. It supports various data types and operations, enabling developers to create complex neural networks and perform advanced computations. However, TensorFlow is susceptible to vulnerabilities that can arise from improper handling of inputs, such as non-UTF-8 byte strings, which can lead to unexpected behavior or crashes.
Vulnerability Detail
The vulnerability identified as CVE-2022-41908 occurs in the TensorFlow library, specifically within the tf.raw_ops.PyFunc operation. When a non-UTF-8 byte string is provided as an input token, it triggers a CHECK fail, causing the program to terminate unexpectedly. This can lead to denial of service, as applications relying on TensorFlow may crash when encountering such inputs. The vulnerability stems from inadequate input validation, making it critical for developers to ensure that inputs conform to expected formats.
How To Fix
Latest published version: 2.21.0 as of 22 Oct 2026
pip install --upgrade "tensorflow==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.8.42.8.4pip install --upgrade "tensorflow==2.8.4" -
>= 2.9.0, < 2.9.32.9.3pip install --upgrade "tensorflow==2.9.3" -
>= 2.10.0, < 2.10.12.10.1pip install --upgrade "tensorflow==2.10.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 workaround, ensure that any token inputs passed to tf.raw_ops.PyFunc are valid UTF-8 byte strings. For example, you can validate your token input as follows:
import tensorflow as tf
value = tf.constant(value=[1, 2])
token = b'\xE2\x9C\x94' # Valid UTF-8 token
dataType = [tf.int32]
tf.raw_ops.PyFunc(input=value, token=token, Tout=dataType)
Conclusion
CVE-2022-41908 is a significant vulnerability in TensorFlow that can lead to application crashes due to improper handling of input tokens. It is crucial to update to the latest patched versions to mitigate this risk and ensure the stability of your applications.
See every vulnerability recorded for tensorflow →
FAQ
CVE-2022-41908 is a vulnerability in TensorFlow that causes a CHECK fail when a non-UTF-8 byte string is used as an input token in the tf.raw_ops.PyFunc operation.
If your application uses TensorFlow and passes invalid token inputs to tf.raw_ops.PyFunc, it may crash, leading to potential denial of service.
TensorFlow versions prior to 2.8.4, 2.9.3, and 2.10.1 are affected by this vulnerability.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. Visit Vulert Scanner to check your application without needing to sign up.
The CVSS score for this vulnerability is 4.8, indicating a moderate severity level.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.