`CHECK` failure in `SobolSample` via missing validation in TensorFlow
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.
| Package | Affected versions | Patched versions |
|---|---|---|
tensorflowPyPI | < 2.7.2 | 2.7.2 |
tensorflowPyPI | >= 2.8.0, < 2.8.1 | 2.8.1 |
tensorflowPyPI | >= 2.9.0, < 2.9.1 | 2.9.1 |
tensorflow-cpuPyPI | < 2.7.2 | 2.7.2 |
tensorflow-cpuPyPI | >= 2.8.0, < 2.8.1 | 2.8.1 |
tensorflow-cpuPyPI | >= 2.9.0, < 2.9.1 | 2.9.1 |
tensorflow-gpuPyPI | < 2.7.2 | 2.7.2 |
tensorflow-gpuPyPI | >= 2.8.0, < 2.8.1 | 2.8.1 |
tensorflow-gpuPyPI | >= 2.9.0, < 2.9.1 | 2.9.1 |
Affected products
1- Range: < 2.7.2
Patches
1c65c67f88ad7Fix `CHECK`-fail due to passing invalid tensors in `SobolOp`.
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- github.com/advisories/GHSA-97p7-w86h-vcf9ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2022-35935ghsaADVISORY
- github.com/tensorflow/tensorflow/commit/c65c67f88ad770662e8f191269a907bf2b94b1bfghsax_refsource_MISCWEB
- github.com/tensorflow/tensorflow/releases/tag/v2.10.0ghsaWEB
- github.com/tensorflow/tensorflow/security/advisories/GHSA-97p7-w86h-vcf9ghsax_refsource_CONFIRMWEB
News mentions
0No linked articles in our index yet.