VYPR
Moderate severityNVD Advisory· Published Sep 16, 2022· Updated Apr 23, 2025

`CHECK` failure in `SobolSample` via missing validation in TensorFlow

CVE-2022-35935

Description

TensorFlow is an open source platform for machine learning. The implementation of SobolSampleOp is vulnerable to a denial of service via CHECK-failure (assertion failure) caused by assuming input(0), input(1), and input(2) to be scalar. This issue has been patched in GitHub commit c65c67f88ad770662e8f191269a907bf2b94b1bf. The fix will be included in TensorFlow 2.10.0. We will also cherrypick this commit on TensorFlow 2.9.1, TensorFlow 2.8.1, and TensorFlow 2.7.2, as these are also affected and still in supported range. There are no known workarounds for this issue.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
tensorflowPyPI
< 2.7.22.7.2
tensorflowPyPI
>= 2.8.0, < 2.8.12.8.1
tensorflowPyPI
>= 2.9.0, < 2.9.12.9.1
tensorflow-cpuPyPI
< 2.7.22.7.2
tensorflow-cpuPyPI
>= 2.8.0, < 2.8.12.8.1
tensorflow-cpuPyPI
>= 2.9.0, < 2.9.12.9.1
tensorflow-gpuPyPI
< 2.7.22.7.2
tensorflow-gpuPyPI
>= 2.8.0, < 2.8.12.8.1
tensorflow-gpuPyPI
>= 2.9.0, < 2.9.12.9.1

Affected products

1

Patches

1
c65c67f88ad7

Fix `CHECK`-fail due to passing invalid tensors in `SobolOp`.

https://github.com/tensorflow/tensorflowMihai MaruseacJul 13, 2022via ghsa
1 file changed · +7 0
  • tensorflow/core/kernels/sobol_op.cc+7 0 modified
    @@ -24,6 +24,7 @@ limitations under the License.
     #include "sobol_data.h"  // from @sobol_data
     #include "tensorflow/core/framework/device_base.h"
     #include "tensorflow/core/framework/op_kernel.h"
    +#include "tensorflow/core/framework/tensor_shape.h"
     #include "tensorflow/core/lib/core/threadpool.h"
     #include "tensorflow/core/platform/platform_strings.h"
     
    @@ -134,8 +135,14 @@ class SobolSampleOp : public OpKernel {
           : OpKernel(context) {}
     
       void Compute(OpKernelContext* context) override {
    +    OP_REQUIRES(context, TensorShapeUtils::IsScalar(context->input(0).shape()),
    +                errors::InvalidArgument("dim must be a scalar"));
         int32_t dim = context->input(0).scalar<int32_t>()();
    +    OP_REQUIRES(context, TensorShapeUtils::IsScalar(context->input(0).shape()),
    +                errors::InvalidArgument("num_results must be a scalar"));
         int32_t num_results = context->input(1).scalar<int32_t>()();
    +    OP_REQUIRES(context, TensorShapeUtils::IsScalar(context->input(0).shape()),
    +                errors::InvalidArgument("skip must be a scalar"));
         int32_t skip = context->input(2).scalar<int32_t>()();
     
         OP_REQUIRES(context, dim >= 1,
    

Vulnerability mechanics

Synthesis attempt was rejected by the grounding validator. Re-run pending.

References

5

News mentions

0

No linked articles in our index yet.