`CHECK` fail in `RaggedTensorToVariant` in TensorFlow
Description
TensorFlow is an open source platform for machine learning. If RaggedTensorToVariant is given a rt_nested_splits list that contains tensors of ranks other than one, it results in a CHECK fail that can be used to trigger a denial of service attack. We have patched the issue in GitHub commit 88f93dfe691563baa4ae1e80ccde2d5c7a143821. 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
188f93dfe6915[security] Fix failed shape check in RaggedTensorToVariant.
2 files changed · +19 −0
tensorflow/core/kernels/ragged_tensor_to_variant_op.cc+4 −0 modified@@ -188,6 +188,10 @@ class RaggedTensorToVariantOp : public OpKernel { batched_ragged_input.mutable_nested_splits()->reserve( ragged_nested_splits_len); for (int i = 0; i < ragged_nested_splits_len; i++) { + OP_REQUIRES(context, ragged_nested_splits_in[i].dims() == 1, + errors::InvalidArgument("Requires nested_row_splits[", i, "]", + " to be rank 1 but is rank ", + ragged_nested_splits_in[i].dims())); batched_ragged_input.append_splits(ragged_nested_splits_in[i]); }
tensorflow/python/ops/ragged/ragged_tensor_test.py+15 −0 modified@@ -1468,6 +1468,21 @@ def testUnbatchVariantInDataset(self): for i in range(3): self.assertAllEqual(sess.run(rt[i]), out) + def testToVariantInvalidParams(self): + self.assertRaisesRegex((ValueError, errors.InvalidArgumentError), + r'be rank 1 but is rank 0', + gen_ragged_conversion_ops.ragged_tensor_to_variant, + rt_nested_splits=[0, 1, 2], + rt_dense_values=[0, 1, 2], + batched_input=True) + + self.assertRaisesRegex((ValueError, errors.InvalidArgumentError), + r'be rank 1 but is rank 2', + gen_ragged_conversion_ops.ragged_tensor_to_variant, + rt_nested_splits=[[[0]], [[1]], [[2]]], + rt_dense_values=[0, 1, 2], + batched_input=True) + def testFromVariantInvalidParams(self): rt = ragged_factory_ops.constant([[0], [1], [2], [3]]) batched_variant = rt._to_variant(batched_input=True)
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-m6cv-4fmf-66xfghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2022-36018ghsaADVISORY
- github.com/tensorflow/tensorflow/commit/88f93dfe691563baa4ae1e80ccde2d5c7a143821ghsax_refsource_MISCWEB
- github.com/tensorflow/tensorflow/releases/tag/v2.10.0ghsaWEB
- github.com/tensorflow/tensorflow/security/advisories/GHSA-m6cv-4fmf-66xfghsax_refsource_CONFIRMWEB
News mentions
0No linked articles in our index yet.