CVE-2021-41199: Overflow/crash in tf.image.resize when size is large

tensorflow Updated 02 Oct 2025

Summary

10/11/2021
Yes i
Moderate
5.5

CVE-2021-41199: Overflow/crash in tf.image.resize when size is large. Affects tensorflow across 3 version ranges.

< 2.4.4 >= 2.5.0, < 2.5.2 >= 2.6.0, < 2.6.1

Fixed in 2.4.4, 2.5.2 or 2.6.1, depending on the release line you run. How to fix ↓

Also tracked for

The same CVE-2021-41199 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

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

The TensorFlow package is an open-source machine learning framework developed by Google. It provides a comprehensive set of tools and libraries for building and deploying machine learning models. The tf.image.resize function is a part of TensorFlow's image processing module and is used to resize images. This vulnerability affects versions 2.4.4 to 2.6.0 of the TensorFlow package.

Vulnerability Detail

The vulnerability arises when the tf.image.resize function is called with a large input argument. This causes an overflow in the number of elements in the output tensor, leading to a CHECK-failure and subsequent process crash. The issue has a CVSS score of 5.5, indicating a moderate severity level. An attacker could potentially exploit this vulnerability to crash TensorFlow processes, causing denial of service.

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.4.4 2.4.4
    pip install --upgrade "tensorflow==2.4.4"
  • >= 2.5.0, < 2.5.2 2.5.2
    pip install --upgrade "tensorflow==2.5.2"
  • >= 2.6.0, < 2.6.1 2.6.1
    pip install --upgrade "tensorflow==2.6.1"

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

Workaround

A workaround for this vulnerability is to avoid calling the tf.image.resize function with large input arguments. Instead, users can resize images in smaller batches or use alternative image resizing methods available in TensorFlow.

Conclusion

The overflow/crash vulnerability in tf.image.resize in TensorFlow has been addressed in the latest patched versions. Users are advised to update their TensorFlow packages to the fixed versions to mitigate the risk of process crashes. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for tensorflow →

Share this vulnerability

FAQ

TensorFlow is an open-source machine learning framework developed by Google. It provides tools and libraries for building and deploying machine learning models.

tf.image.resize is a function in TensorFlow's image processing module used to resize images.

Versions 2.4.4 to 2.6.0 of the TensorFlow package are affected.

Calling tf.image.resize with a large input argument can cause a CHECK-failure and crash the TensorFlow process, leading to denial of service.

To fix this vulnerability, update your TensorFlow package to the patched versions: 2.6.1, 2.5.2, or 2.4.4.

Related vulnerabilities

Recent vulnerabilities recorded for tensorflow.

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.4.4 2.4.4
    pip install --upgrade "tensorflow==2.4.4"
  • >= 2.5.0, < 2.5.2 2.5.2
    pip install --upgrade "tensorflow==2.5.2"
  • >= 2.6.0, < 2.6.1 2.6.1
    pip install --upgrade "tensorflow==2.6.1"

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