CVE-2022-41896: TensorFlow CPU Package Crashes Due to Invalid Mfcc Input
Summary
CVE-2022-41896: tf.raw_ops.Mfcc crashes. Affects tensorflow-cpu 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 · PyPI
- tensorflow-gpu · PyPI
- tensorflow · Bitnami
- tensorflow · PyPI
The same CVE-2022-41896 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 widely used for various applications, including deep learning and neural networks. The 'tensorflow-cpu' package provides CPU support for TensorFlow, allowing users to perform computations without the need for a GPU. This package is essential for developers who want to leverage TensorFlow's capabilities in environments where GPU resources are limited. However, it is crucial to ensure that the package is kept up to date to avoid vulnerabilities that could lead to crashes or other security issues.
Vulnerability Detail
The vulnerability identified as CVE-2022-41896 arises from the 'tf.raw_ops.Mfcc' function within the TensorFlow library. If the 'filterbank_channel_count' parameter is set to a value greater than the maximum allowed size, TensorFlow will crash. This issue can occur when users inadvertently provide invalid input, leading to a denial of service. The crash is triggered by the 'ThreadUnsafeUnigramCandidateSampler' when it processes the invalid input, making it critical for users to validate their parameters before invoking this function.
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.8.42.8.4pip install --upgrade "tensorflow-cpu==2.8.4" -
>= 2.9.0, < 2.9.32.9.3pip install --upgrade "tensorflow-cpu==2.9.3" -
>= 2.10.0, < 2.10.12.10.1pip install --upgrade "tensorflow-cpu==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 temporary workaround, users should ensure that the 'filterbank_channel_count' parameter is set within the valid range. For example, using a value less than or equal to the maximum allowed size:
import tensorflow as tf
tf.raw_ops.Mfcc(
spectrogram = [[[1.38, 6.32, 5.75, 9.51]]],
sample_rate = 2,
upper_frequency_limit = 5.0,
lower_frequency_limit = 1.0,
filterbank_channel_count = 128, # Use a valid value
dct_coefficient_count = 1
)
Conclusion
In summary, CVE-2022-41896 is a critical vulnerability in the TensorFlow CPU package that can lead to application crashes due to invalid input parameters. Users are advised to update their packages to the latest patched versions and validate their inputs to prevent such issues.
See every vulnerability recorded for tensorflow-cpu →
FAQ
CVE-2022-41896 is a vulnerability in the TensorFlow CPU package that causes the application to crash when invalid input is provided to the Mfcc function.
You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
The primary consequence is a denial of service, as the application will crash when the invalid input is processed, potentially disrupting user operations.
You can update the TensorFlow package using pip commands to install the patched versions, such as 'pip install --upgrade tensorflow-cpu==2.10.1'.
Yes, ensure that the 'filterbank_channel_count' parameter is set to a valid value within the allowed range to prevent the crash.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow-cpu.