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

`CHECK` fail in `tf.sparse.cross` in TensorFlow

CVE-2022-35997

Description

TensorFlow is an open source platform for machine learning. If tf.sparse.cross receives an input separator that is not a scalar, it gives a CHECK fail that can be used to trigger a denial of service attack. We have patched the issue in GitHub commit 83dcb4dbfa094e33db084e97c4d0531a559e0ebf. 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.9.0, < 2.9.12.9.1
tensorflow-gpuPyPI
< 2.7.22.7.2
tensorflow-gpuPyPI
>= 2.8.0, < 2.8.12.8.1

Affected products

1

Patches

1
83dcb4dbfa09

Fix check failure in SparseCrossV2Op by adding check for scalar value for separator.

https://github.com/tensorflow/tensorflowIsha ArkatkarJul 14, 2022via ghsa
2 files changed · +14 0
  • tensorflow/core/kernels/sparse_cross_op.cc+6 0 modified
    @@ -24,12 +24,14 @@ limitations under the License.
     #include "tensorflow/core/framework/kernel_def_builder.h"
     #include "tensorflow/core/framework/op_def_builder.h"
     #include "tensorflow/core/framework/op_kernel.h"
    +#include "tensorflow/core/framework/op_requires.h"
     #include "tensorflow/core/framework/tensor.h"
     #include "tensorflow/core/framework/tensor_shape.h"
     #include "tensorflow/core/framework/types.h"
     #include "tensorflow/core/framework/types.pb.h"
     #include "tensorflow/core/lib/core/stringpiece.h"
     #include "tensorflow/core/lib/strings/str_util.h"
    +#include "tensorflow/core/platform/errors.h"
     #include "tensorflow/core/platform/fingerprint.h"
     #include "tensorflow/core/platform/strong_hash.h"
     #include "tensorflow/core/util/work_sharder.h"
    @@ -832,6 +834,10 @@ class SparseCrossV2Op : public OpKernel {
     
         const Tensor* sep_t;
         OP_REQUIRES_OK(context, context->input("sep", &sep_t));
    +    OP_REQUIRES(context, TensorShapeUtils::IsScalar(sep_t->shape()),
    +                errors::InvalidArgument("Input separator should be a scalar. "
    +                                        "Received: ",
    +                                        sep_t->DebugString()));
         const tstring separator = sep_t->scalar<tstring>()();
     
         std::vector<std::unique_ptr<ColumnInterface<tstring>>> columns =
    
  • tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py+8 0 modified
    @@ -873,6 +873,14 @@ def test_all_columns_empty(self):
         with self.cached_session():
           self._assert_sparse_tensor_empty(self.evaluate(out))
     
    +  def testNonScalarInput(self):
    +    with self.assertRaisesRegex(errors.InvalidArgumentError,
    +                                'Input separator should be a scalar.'):
    +      self.evaluate(sparse_ops.sparse_cross(
    +          inputs=[],
    +          name='a',
    +          separator=constant_op.constant(['a', 'b'], dtype=dtypes.string)))
    +
     
     class SparseCrossHashedOpTest(BaseSparseCrossOpTest):
     
    

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

5

News mentions

0

No linked articles in our index yet.