VYPR
Low severityNVD Advisory· Published May 14, 2021· Updated Aug 3, 2024

Lack of validation in `SparseDenseCwiseMul`

CVE-2021-29567

Description

TensorFlow is an end-to-end open source platform for machine learning. Due to lack of validation in tf.raw_ops.SparseDenseCwiseMul, an attacker can trigger denial of service via CHECK-fails or accesses to outside the bounds of heap allocated data. Since the implementation(https://github.com/tensorflow/tensorflow/blob/38178a2f7a681a7835bb0912702a134bfe3b4d84/tensorflow/core/kernels/sparse_dense_binary_op_shared.cc#L68-L80) only validates the rank of the input arguments but no constraints between dimensions(https://www.tensorflow.org/api_docs/python/tf/raw_ops/SparseDenseCwiseMul), an attacker can abuse them to trigger internal CHECK assertions (and cause program termination, denial of service) or to write to memory outside of bounds of heap allocated tensor buffers. The fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2, TensorFlow 2.3.3, TensorFlow 2.2.3 and TensorFlow 2.1.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.1.42.1.4
tensorflowPyPI
>= 2.2.0, < 2.2.32.2.3
tensorflowPyPI
>= 2.3.0, < 2.3.32.3.3
tensorflowPyPI
>= 2.4.0, < 2.4.22.4.2
tensorflow-cpuPyPI
< 2.1.42.1.4
tensorflow-cpuPyPI
>= 2.2.0, < 2.2.32.2.3
tensorflow-cpuPyPI
>= 2.3.0, < 2.3.32.3.3
tensorflow-cpuPyPI
>= 2.4.0, < 2.4.22.4.2
tensorflow-gpuPyPI
< 2.1.42.1.4
tensorflow-gpuPyPI
>= 2.2.0, < 2.2.32.2.3
tensorflow-gpuPyPI
>= 2.3.0, < 2.3.32.3.3
tensorflow-gpuPyPI
>= 2.4.0, < 2.4.22.4.2

Affected products

1

Patches

1
7ae2af34087f

Fix heap-buffer-overflow issue with `tf.raw_ops.SparseDenseCwiseMul`.

https://github.com/tensorflow/tensorflowAmit PatankarMay 5, 2021via ghsa
1 file changed · +5 0
  • tensorflow/core/kernels/sparse_dense_binary_op_shared.cc+5 0 modified
    @@ -78,6 +78,11 @@ class SparseDenseBinaryOpShared : public OpKernel {
                         "but received shapes: ",
                         values_t->shape().DebugString(), " and ",
                         shape_t->shape().DebugString()));
    +    OP_REQUIRES(
    +        ctx, values_t->dim_size(0) == indices_t->dim_size(0),
    +        errors::InvalidArgument(
    +            "The first dimension of values and indices should match. (",
    +            values_t->dim_size(0), " vs. ", indices_t->dim_size(0), ")"));
     
         const auto indices_mat = indices_t->matrix<int64>();
         const auto shape_vec = shape_t->vec<int64>();
    

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.