CVE-2022-41885: TensorFlow FusedResizeAndPadConv2D Overflow Vulnerability
Summary
CVE-2022-41885: Overflow in FusedResizeAndPadConv2D. Affects tensorflow across 3 version ranges.
< 2.7.4
>= 2.8.0, < 2.8.1
>= 2.9.0, < 2.9.1
Fixed in 2.7.4, 2.8.1 or 2.9.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-41885 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, widely used for building and training machine learning models. It provides a flexible ecosystem of tools, libraries, and community resources that allows researchers and developers to create and deploy ML-powered applications. The library includes various operations for manipulating tensors, including the FusedResizeAndPadConv2D operation, which is designed to resize and pad convolutional layers efficiently. However, a vulnerability has been identified in this operation that can lead to overflow issues when handling large tensor shapes.
Vulnerability Detail
The vulnerability arises in the FusedResizeAndPadConv2D operation when it is provided with a large tensor shape, leading to an overflow condition. This can result in unexpected behavior, including potential crashes or incorrect computations. The issue is triggered when the input tensor size exceeds certain limits, causing the operation to fail or produce erroneous results. This vulnerability can be exploited by attackers to manipulate the input tensor dimensions, potentially leading to denial of service or other unintended consequences.
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.7.42.7.4pip install --upgrade "tensorflow==2.7.4" -
>= 2.8.0, < 2.8.12.8.1pip install --upgrade "tensorflow==2.8.1" -
>= 2.9.0, < 2.9.12.9.1pip install --upgrade "tensorflow==2.9.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, users can avoid using excessively large tensor shapes when calling the FusedResizeAndPadConv2D operation. Here is an example of how to call the operation safely with smaller tensor sizes:
import tensorflow as tf
mode = "REFLECT"
strides = [1, 1, 1, 1]
padding = "SAME"
resize_align_corners = False
input = tf.constant(147, shape=[3,3,1,1], dtype=tf.float16)
size = tf.constant([100, 100], shape=[2], dtype=tf.int32) # Use smaller size
paddings = tf.constant([3,4], shape=[2], dtype=tf.int32)
filter = tf.constant(123, shape=[1,3,4,1], dtype=tf.float16)
tf.raw_ops.FusedResizeAndPadConv2D(input=input, size=size, paddings=paddings, filter=filter, mode=mode, strides=strides, padding=padding, resize_align_corners=resize_align_corners)
Conclusion
The CVE-2022-41885 vulnerability in TensorFlow's FusedResizeAndPadConv2D operation poses a risk when handling large tensor shapes, leading to potential overflow issues. Users are advised to update to the latest patched versions of TensorFlow to mitigate this risk. Additionally, using smaller tensor sizes can serve as a temporary workaround.
See every vulnerability recorded for tensorflow →
FAQ
CVE-2022-41885 is a vulnerability in TensorFlow's FusedResizeAndPadConv2D operation that can lead to overflow issues when handling large tensor shapes.
You can use Vulert's playground to check if your application is affected by this vulnerability without needing to sign up.
Exploiting this vulnerability can lead to unexpected behavior, including application crashes or incorrect computations.
You can update TensorFlow by running the command 'pip install --upgrade tensorflow' to install the patched version.
The CVSS score for this vulnerability is 4.8, indicating a moderate level of severity.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.