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

CHECK-fail in `LoadAndRemapMatrix`

CVE-2021-29561

Description

TensorFlow is an end-to-end open source platform for machine learning. An attacker can cause a denial of service by exploiting a CHECK-failure coming from tf.raw_ops.LoadAndRemapMatrix. This is because the implementation(https://github.com/tensorflow/tensorflow/blob/d94227d43aa125ad8b54115c03cece54f6a1977b/tensorflow/core/kernels/ragged_tensor_to_tensor_op.cc#L219-L222) assumes that the ckpt_path is always a valid scalar. However, an attacker can send any other tensor as the first argument of LoadAndRemapMatrix. This would cause the rank CHECK in scalar<T>()() to trigger and terminate the process. 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
77dd114513d7

Fix a check fail

https://github.com/tensorflow/tensorflowMihai MaruseacMay 4, 2021via ghsa
1 file changed · +5 0
  • tensorflow/core/kernels/load_and_remap_matrix_op.cc+5 0 modified
    @@ -123,6 +123,11 @@ class LoadAndRemapMatrixOp : public OpKernel {
         // Processes the checkpoint source and the provided Tensor name.
         const Tensor* ckpt_path_t;
         OP_REQUIRES_OK(context, context->input("ckpt_path", &ckpt_path_t));
    +    OP_REQUIRES(
    +        context, ckpt_path_t->NumElements() == 1,
    +        errors::InvalidArgument("The `ckpt_path` tensor must have exactly one "
    +                                "element, got tensor of shape ",
    +                                ckpt_path_t->shape().DebugString()));
         const string& ckpt_path = ckpt_path_t->scalar<tstring>()();
         const Tensor* old_tensor_name_t;
         OP_REQUIRES_OK(context,
    

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.