`CHECK` fail in `CollectiveGather` in TensorFlow
Description
TensorFlow is an open source platform for machine learning. When CollectiveGather receives an scalar input input, it gives a CHECK fails that can be used to trigger a denial of service attack. We have patched the issue in GitHub commit c1f491817dec39a26be3c574e86a88c30f3c4770. 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
1c1f491817decFix for check failure in CollectiveGather op.
2 files changed · +18 −0
tensorflow/core/kernels/collective_ops.cc+4 −0 modified@@ -176,6 +176,10 @@ class CollectiveGatherOpKernel : public CollectiveOpV1Kernel { void ComputeAsyncImpl(OpKernelContext* c, CollectiveExecutor* col_exec, DoneCallback done) override { auto output_shape = c->input(0).shape(); + OP_REQUIRES_ASYNC(c, output_shape.dims() > 0, + errors::InvalidArgument("input should have rank > 0, ", + "recieved ", output_shape.dims()), + done); output_shape.set_dim( 0, output_shape.dim_size(0) * col_params_->group.group_size); col_params_->instance.shape = output_shape;
tensorflow/python/ops/collective_ops_test.py+14 −0 modified@@ -451,6 +451,20 @@ def testCollectiveGroupSizeMismatch(self): ]) context.ensure_initialized() + @test_util.run_v2_only + def testCollectiveGatherShapeCheckFailure(self): + with self.assertRaisesRegex(errors.InvalidArgumentError, + 'input should have rank > 0'): + collective_ops.gen_collective_ops.CollectiveGather( + input=1, + group_size=1, + group_key=1, + instance_key=1, + shape=(3, 3, 3), + communication_hint='auto', + timeout_seconds=0, + name='') + @def_function.function def run_all_reduce(): group_key = 10
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- github.com/advisories/GHSA-fhfc-2q7x-929fghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2022-35994ghsaADVISORY
- github.com/tensorflow/tensorflow/commit/c1f491817dec39a26be3c574e86a88c30f3c4770ghsax_refsource_MISCWEB
- github.com/tensorflow/tensorflow/releases/tag/v2.10.0ghsaWEB
- github.com/tensorflow/tensorflow/security/advisories/GHSA-fhfc-2q7x-929fghsax_refsource_CONFIRMWEB
News mentions
0No linked articles in our index yet.