CVE-2021-37666: TensorFlow - Reference Binding to Null Pointer in tf.raw_ops.RaggedTensorToVariant

tensorflow Updated 02 Oct 2025

Summary

12/08/2021
Yes i
High
7.8

CVE-2021-37666: TensorFlow is an end-to-end open source platform for machine learning. Affects tensorflow across 3 version ranges.

>= 2.3.0, < 2.3.4 >= 2.4.0, < 2.4.3 < be7a4de6adfbd303ce08be4332554dff70362612

Fixed in 2.3.4 or 2.4.3, depending on the release line you run. How to fix ↓

Also tracked for

The same CVE-2021-37666 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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

TensorFlow is an end-to-end open source platform for machine learning. It provides a comprehensive ecosystem of tools, libraries, and resources for developing and deploying machine learning models. TensorFlow is widely used in various industries and research domains for tasks such as image recognition, natural language processing, and recommendation systems. However, a vulnerability has been discovered in TensorFlow that allows an attacker to cause undefined behavior by binding a reference to a null pointer in the tf.raw_ops.RaggedTensorToVariant function.

Vulnerability Detail

The vulnerability arises from an incomplete validation of the splits values in the implementation of tf.raw_ops.RaggedTensorToVariant. The validation does not account for the case when the splits argument is empty. This oversight allows an attacker to pass a null pointer as the splits argument, leading to undefined behavior. The impact of this vulnerability can vary depending on the specific usage of TensorFlow in an application. However, it could potentially result in crashes, memory corruption, or other unpredictable behavior, which may be exploitable by an attacker.

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.3.0, < 2.3.4 2.3.4
    pip install --upgrade "tensorflow==2.3.4"
  • >= 2.4.0, < 2.4.3 2.4.3
    pip install --upgrade "tensorflow==2.4.3"

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 manually validate the splits argument before passing it to the tf.raw_ops.RaggedTensorToVariant function. This can be done by checking if the splits argument is empty and handling it appropriately in the application code. Here is an example of how to perform this validation in Python:

splits = [...]  # The splits argument

if splits:
    # Call tf.raw_ops.RaggedTensorToVariant with validated splits
    tf.raw_ops.RaggedTensorToVariant(splits)
else:
    # Handle empty splits case
    ...

Conclusion

In conclusion, TensorFlow versions 2.3.0 and above are vulnerable to a reference binding to null pointer vulnerability in the tf.raw_ops.RaggedTensorToVariant function. This vulnerability can lead to undefined behavior and potential exploitation by an attacker. Users should update their TensorFlow installations to one of the patched versions (2.6.0, 2.5.1, 2.4.3, or 2.3.4) to mitigate the risk. Additionally, a workaround is available for manually validating the splits argument. 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 platform for machine learning that provides a comprehensive set of tools and resources for developing and deploying machine learning models.

The impact of this vulnerability can vary depending on the specific usage of TensorFlow in an application. However, it could potentially result in crashes, memory corruption, or other unpredictable behavior, which may be exploitable by an attacker.

The vulnerability affects TensorFlow versions 2.3.0 and above. Specifically, versions 2.3.0 to 2.3.4, 2.4.0 to 2.4.3, 2.5.1, and 2.6.0 are affected.

To fix the vulnerability, users of TensorFlow should update their installations to one of the patched versions: TensorFlow 2.6.0, TensorFlow 2.5.1, TensorFlow 2.4.3, or TensorFlow 2.3.4. Updating to the latest available version is recommended.

Yes, a workaround is available. Users can manually validate the splits argument before passing it to the tf.raw_ops.RaggedTensorToVariant function. This involves checking if the splits argument is empty and handling it appropriately in the application code.

Related vulnerabilities

Recent vulnerabilities recorded for tensorflow.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

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.3.0, < 2.3.4 2.3.4
    pip install --upgrade "tensorflow==2.3.4"
  • >= 2.4.0, < 2.4.3 2.4.3
    pip install --upgrade "tensorflow==2.4.3"

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