CVE-2021-37637: TensorFlow Null Pointer Dereference in tf.raw_ops.CompressElement

tensorflow Updated 02 Oct 2025

Summary

12/08/2021
Yes i
High
7.7

CVE-2021-37637: 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 < 5dc7f6981fdaf74c8c5be41f393df705841fb7c5

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-37637 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 Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

TensorFlow is an end-to-end open source platform for machine learning. It provides a comprehensive ecosystem for building and deploying machine learning models. TensorFlow is widely used in various domains, including research, industry, and academia. It offers a range of functionalities, such as data preprocessing, model training, and model serving. However, a vulnerability has been identified in TensorFlow that can lead to a null pointer dereference when an invalid input is passed to the tf.raw_ops.CompressElement function.

Vulnerability Detail

The vulnerability originates from a flaw in the implementation of the tf.raw_ops.CompressElement function in TensorFlow. The implementation fails to validate the buffer obtained from a separate function call before accessing its size. This can result in a null pointer dereference when an invalid buffer is passed as input. An attacker could exploit this vulnerability by crafting a malicious input that triggers the null pointer dereference, potentially leading to a denial of service (DoS) condition or other unexpected behavior. The vulnerability has been assigned the identifier CVE-2021-37637.

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

There is no specific workaround provided for this vulnerability. Users are advised to follow the recommended steps for fixing the vulnerability by updating to the patched versions of TensorFlow.

Conclusion

In conclusion, a vulnerability has been identified in TensorFlow that can lead to a null pointer dereference in the tf.raw_ops.CompressElement function. This vulnerability has been assigned the identifier CVE-2021-37637. Users of TensorFlow are advised to update to the latest patched version (2.6.0) or one of the backported patched versions (2.5.1, 2.4.3, or 2.3.4) to mitigate the vulnerability. 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 ecosystem for building and deploying machine learning models.

The vulnerability can lead to a null pointer dereference in TensorFlow, potentially resulting in a denial of service (DoS) condition or other unexpected behavior.

To fix this vulnerability, users of TensorFlow should update to the latest patched version (2.6.0) once it becomes available. Alternatively, users can upgrade to one of the backported patched versions (2.5.1, 2.4.3, or 2.3.4).

No specific workaround is provided for this vulnerability. It is recommended to follow the steps for fixing the vulnerability by updating to the patched versions of TensorFlow.

More information about this vulnerability can be found in the GitHub advisory database at the following source: https://github.com/pypa/advisory-database/blob/main/vulns/tensorflow/PYSEC-2021-259.yaml

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.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