VYPR
High severityNVD Advisory· Published Aug 12, 2021· Updated Aug 4, 2024

Null pointer dereference in `UncompressElement` in TensorFlow

CVE-2021-37649

Description

TensorFlow is an end-to-end open source platform for machine learning. The code for tf.raw_ops.UncompressElement can be made to trigger a null pointer dereference. The implementation obtains a pointer to a CompressedElement from a Variant tensor and then proceeds to dereference it for decompressing. There is no check that the Variant tensor contained a CompressedElement, so the pointer is actually nullptr. We have patched the issue in GitHub commit 7bdf50bb4f5c54a4997c379092888546c97c3ebd. The fix will be included in TensorFlow 2.6.0. We will also cherrypick this commit on TensorFlow 2.5.1, TensorFlow 2.4.3, and TensorFlow 2.3.4, as these are also affected and still in supported range.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
tensorflowPyPI
< 2.3.42.3.4
tensorflowPyPI
>= 2.4.0, < 2.4.32.4.3
tensorflowPyPI
>= 2.5.0, < 2.5.12.5.1
tensorflow-cpuPyPI
< 2.3.42.3.4
tensorflow-cpuPyPI
>= 2.4.0, < 2.4.32.4.3
tensorflow-cpuPyPI
>= 2.5.0, < 2.5.12.5.1
tensorflow-gpuPyPI
< 2.3.42.3.4
tensorflow-gpuPyPI
>= 2.4.0, < 2.4.32.4.3
tensorflow-gpuPyPI
>= 2.5.0, < 2.5.12.5.1

Affected products

1

Patches

1
7bdf50bb4f5c

Ensure non-empty compressed input in tf.raw_ops.UncompressElement

https://github.com/tensorflow/tensorflowLaura PakJul 10, 2021via ghsa
1 file changed · +5 0
  • tensorflow/core/kernels/data/experimental/compression_ops.cc+5 0 modified
    @@ -48,6 +48,11 @@ void UncompressElementOp::Compute(OpKernelContext* ctx) {
       Tensor tensor = ctx->input(0);
       const Variant& variant = tensor.scalar<Variant>()();
       const CompressedElement* compressed = variant.get<CompressedElement>();
    +  OP_REQUIRES(
    +      ctx, compressed != nullptr,
    +      errors::InvalidArgument(
    +          "Input does not contain a compressed element. Instead got tensor ",
    +          tensor.DebugString()));
     
       std::vector<Tensor> components;
       OP_REQUIRES_OK(ctx, UncompressElement(*compressed, &components));
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

7

News mentions

0

No linked articles in our index yet.