CVE-2021-41199: TensorFlow - Integer Overflow in tf.image.resize

tensorflow Updated 02 Oct 2025

Summary

05/11/2021
Yes i
Moderate
5.5

CVE-2021-41199: TensorFlow is an open source platform for machine learning. Affects tensorflow across 5 version ranges.

< 2.4.4 >= 2.5.0, < 2.5.2 >= 2.6.0, < 2.6.1 >= 2.7.0rc0, < 2.7.0 < e5272d4204ff5b46136a1ef1204fc00597e21837

Fixed in 4 releases; the minimum fixed version depends 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

TensorFlow is an open-source platform for machine learning. It provides a comprehensive ecosystem of tools, libraries, and resources for building and deploying machine learning models. TensorFlow is widely used in various domains, including computer vision, natural language processing, and deep learning. This vulnerability affects the TensorFlow package and specifically impacts the tf.image.resize function.

Vulnerability Detail

The vulnerability (CVE-2021-41199) arises when the tf.image.resize function is called with a large input argument. In affected versions of TensorFlow, this can lead to a CHECK-failure caused by an integer overflow. The number of elements in the output tensor exceeds the capacity of the int64_t type, triggering the overflow and resulting in a process crash. The issue has been identified and fixed in TensorFlow 2.7.0. However, earlier versions, including TensorFlow 2.6.1, 2.5.2, and 2.4.4, are also affected. The overflow detection is performed through a CHECK statement, which aborts the process upon detection.

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"
  • >= 2.7.0rc0, < 2.7.0 2.7.0
    pip install --upgrade "tensorflow==2.7.0"

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

Workaround

There is no specific workaround mentioned for this vulnerability. The recommended approach is to update TensorFlow to the fixed versions mentioned above.

Conclusion

In conclusion, the vulnerability (CVE-2021-41199) in TensorFlow's tf.image.resize function can lead to a process crash due to an integer overflow when called with a large input argument. It is crucial to update TensorFlow to the fixed versions (2.7.0, 2.6.1, 2.5.2, or 2.4.4) to mitigate this issue. For further support and assistance in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for tensorflow →

Share this vulnerability

FAQ

TensorFlow is an open-source platform for machine learning that provides a comprehensive set of tools and libraries for building and deploying ML models.

The vulnerability can cause a process crash in TensorFlow when the tf.image.resize function is called with a large input argument.

The vulnerability affects TensorFlow versions 2.4.4, 2.5.2, 2.6.1, and earlier. The issue has been fixed in TensorFlow 2.7.0.

To fix this vulnerability, update TensorFlow to version 2.7.0 or upgrade to one of the patched versions: 2.6.1, 2.5.2, or 2.4.4.

No specific workaround has been provided. Updating to the fixed versions is the recommended solution.

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"
  • >= 2.7.0rc0, < 2.7.0 2.7.0
    pip install --upgrade "tensorflow==2.7.0"

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