VYPR
Moderate severityNVD Advisory· Published May 20, 2022· Updated Apr 22, 2025

Missing validation causes denial of service in TensorFlow via `UnsortedSegmentJoin`

CVE-2022-29197

Description

TensorFlow is an open source platform for machine learning. Prior to versions 2.9.0, 2.8.1, 2.7.2, and 2.6.4, the implementation of tf.raw_ops.UnsortedSegmentJoin does not fully validate the input arguments. This results in a CHECK-failure which can be used to trigger a denial of service attack. The code assumes num_segments is a scalar but there is no validation for this before accessing its value. Versions 2.9.0, 2.8.1, 2.7.2, and 2.6.4 contain a patch for this issue.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
tensorflowPyPI
< 2.6.42.6.4
tensorflowPyPI
>= 2.7.0, < 2.7.22.7.2
tensorflowPyPI
>= 2.8.0, < 2.8.12.8.1
tensorflow-cpuPyPI
< 2.6.42.6.4
tensorflow-cpuPyPI
>= 2.7.0, < 2.7.22.7.2
tensorflow-cpuPyPI
>= 2.8.0, < 2.8.12.8.1
tensorflow-gpuPyPI
< 2.6.42.6.4
tensorflow-gpuPyPI
>= 2.7.0, < 2.7.22.7.2
tensorflow-gpuPyPI
>= 2.8.0, < 2.8.12.8.1

Affected products

1

Patches

1
13d38a07ce91

Fix tf.raw_ops.UnsortedSegmentJoin vulnerability with invalid num_segments.

https://github.com/tensorflow/tensorflowAlan LiuApr 28, 2022via ghsa
1 file changed · +3 0
  • tensorflow/core/kernels/unsorted_segment_join_op.cc+3 0 modified
    @@ -92,6 +92,9 @@ class UnsortedSegmentJoinOp : public OpKernel {
         const Tensor& num_segments_tensor = context->input(2);
         OP_REQUIRES(context, num_segments_tensor.NumElements() != 0,
                     errors::InvalidArgument("Number of segments cannot be empty."));
    +    OP_REQUIRES(context,
    +                TensorShapeUtils::IsScalar(num_segments_tensor.shape()),
    +                errors::InvalidArgument("Number of segments must be a scalar"));
         auto num_segments = num_segments_tensor.scalar<NUM_SEGMENTS_TYPE>()();
     
         OP_REQUIRES(
    

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

9

News mentions

0

No linked articles in our index yet.